Karthikeyen92
commited on
Commit
•
439d5b6
1
Parent(s):
fd33638
Update py/handle_files.py
Browse files- py/handle_files.py +4 -2
py/handle_files.py
CHANGED
@@ -43,7 +43,8 @@ def fetch_social_media_data(hugg = False):
|
|
43 |
metadata={"platform":item["platform"],
|
44 |
"company":item["company"],
|
45 |
"ingestion_timestamp":datetime.now().isoformat(),
|
46 |
-
"word_count":len(item["page_content"]["content"])
|
|
|
47 |
}))
|
48 |
return social_media_document
|
49 |
|
@@ -103,6 +104,7 @@ def to_documents(data) -> List[Document]:
|
|
103 |
metadata={"platform":item["platform"],
|
104 |
"company":item["company"],
|
105 |
"ingestion_timestamp":datetime.now().isoformat(),
|
106 |
-
"word_count":len(item["page_content"]["content"])
|
|
|
107 |
}))
|
108 |
return social_media_document
|
|
|
43 |
metadata={"platform":item["platform"],
|
44 |
"company":item["company"],
|
45 |
"ingestion_timestamp":datetime.now().isoformat(),
|
46 |
+
"word_count":len(item["page_content"]["content"]),
|
47 |
+
"link":item["link"] if "link" in item else ""
|
48 |
}))
|
49 |
return social_media_document
|
50 |
|
|
|
104 |
metadata={"platform":item["platform"],
|
105 |
"company":item["company"],
|
106 |
"ingestion_timestamp":datetime.now().isoformat(),
|
107 |
+
"word_count":len(item["page_content"]["content"]),
|
108 |
+
"link": item["link"] if "link" in item else ""
|
109 |
}))
|
110 |
return social_media_document
|