Merge branch 'main' of https://github.com/oxbridge-econ/data-collection-china
Browse files
controllers/vectorizer.py
CHANGED
@@ -76,7 +76,7 @@ def upsert(article, db_collection):
|
|
76 |
if article is None or 'content' not in article:
|
77 |
return None
|
78 |
article = {k: v for k, v in article.items() if v is not None}
|
79 |
-
article["articleid"] = article["id"]
|
80 |
logging.info(article["id"])
|
81 |
del article["id"]
|
82 |
if len(article['subtitle'].encode('utf-8')) > 8000:
|
|
|
76 |
if article is None or 'content' not in article:
|
77 |
return None
|
78 |
article = {k: v for k, v in article.items() if v is not None}
|
79 |
+
article["articleid"] = str(article["id"])
|
80 |
logging.info(article["id"])
|
81 |
del article["id"]
|
82 |
if len(article['subtitle'].encode('utf-8')) > 8000:
|