OxbridgeEconomics
commited on
Update vectorizer.py
Browse files
controllers/vectorizer.py
CHANGED
@@ -36,8 +36,8 @@ def vectorize(article):
|
|
36 |
Returns:
|
37 |
None
|
38 |
"""
|
39 |
-
article['id'] = str(article['id']
|
40 |
-
df = pd.DataFrame(article)
|
41 |
df = df[['id','site','title','titleCN','category','author','content',
|
42 |
'publishDate','link','attachment','sentimentScore','sentimentLabel']]
|
43 |
df['sentimentScore'] = df['sentimentScore'].round(2)
|
|
|
36 |
Returns:
|
37 |
None
|
38 |
"""
|
39 |
+
article['id'] = str(article['id'])
|
40 |
+
df = pd.DataFrame(article, index=[0])
|
41 |
df = df[['id','site','title','titleCN','category','author','content',
|
42 |
'publishDate','link','attachment','sentimentScore','sentimentLabel']]
|
43 |
df['sentimentScore'] = df['sentimentScore'].round(2)
|