Spaces:
Paused
Paused
update store
Browse files
store.py
CHANGED
@@ -18,14 +18,13 @@ def get_documents(path: str):
|
|
18 |
loader = ReadTheDocsLoader(path, encoding="utf-8")
|
19 |
docs = loader.load()
|
20 |
base_url = "https://nvdajp-book.readthedocs.io/"
|
21 |
-
|
22 |
for doc in docs:
|
23 |
org_metadata = doc.metadata
|
24 |
source = _remove_prefix_path(org_metadata["source"])
|
25 |
-
add_meta = {"category":
|
26 |
doc.metadata = org_metadata | add_meta
|
27 |
yield doc
|
28 |
-
# return docs
|
29 |
|
30 |
|
31 |
def get_text_chunk(docs):
|
|
|
18 |
loader = ReadTheDocsLoader(path, encoding="utf-8")
|
19 |
docs = loader.load()
|
20 |
base_url = "https://nvdajp-book.readthedocs.io/"
|
21 |
+
category = "ja-book"
|
22 |
for doc in docs:
|
23 |
org_metadata = doc.metadata
|
24 |
source = _remove_prefix_path(org_metadata["source"])
|
25 |
+
add_meta = {"category": category, "source": source, "url": f"{base_url}{source}"}
|
26 |
doc.metadata = org_metadata | add_meta
|
27 |
yield doc
|
|
|
28 |
|
29 |
|
30 |
def get_text_chunk(docs):
|