You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"If you do NOT find the value of a field in the text, do NOT make up a value. Leave it as null in the JSON output.",
395
395
"Do NOT infer values of fields that are not explicitly mentioned in the text.",
396
396
"Return the JSON as specified in the prompt. Do NOT make up a new JSON with different field names or structure.",
397
-
"Ensure that all parsed values are of the correct data type as defined in the DFT schema.",
397
+
"Ensure that all parsed values are of the correct data type as defined in the targeted section.",
398
398
],
399
399
examples=[],
400
400
),
@@ -428,12 +428,12 @@ import h5py
428
428
from nerxiv.chunker import Chunker
429
429
from nerxiv.rag import CustomRetriever, LLMGenerator, RAGExtractorAgent
430
430
431
-
from.datamodel importDFT
432
-
from.prompt_registry importMOD_PROMPT_REGISTRY
431
+
from datamodel importDFT
432
+
from prompt_registry importPROMPT_REGISTRY
433
433
434
434
435
435
query ="dft"
436
-
entry =MOD_PROMPT_REGISTRY[query]
436
+
entry =PROMPT_REGISTRY[query]
437
437
prompt = entry.prompt
438
438
439
439
@@ -443,7 +443,7 @@ chunker_params = {
443
443
"chunk_overlap": 500,
444
444
}
445
445
retriever_params = {
446
-
"retriever_query": entry.retriever_query,
446
+
"query": entry.retriever_query,
447
447
"model": "all-MiniLM-L6-v2",
448
448
"n_top_chunks": 5,
449
449
"query_name": query,
@@ -470,7 +470,7 @@ with h5py.File(Path("path_to_hdf5.hdf5"), "a") as f:
470
470
agent.run(file=f, text=text, prompt=prompt)
471
471
```
472
472
473
-
This workflow will run the `RAGExtractorAgent`, extract the specific target fields for the specific output schema in the `MOD_PROMPT_REGISTRY` dictionary, and store the results in the HDF5 file containing the queried arXiv PDF information.
473
+
This workflow will run the `RAGExtractorAgent`, extract the specific target fields for the specific output schema in the `PROMPT_REGISTRY` dictionary, and store the results in the HDF5 file containing the queried arXiv PDF information.
474
474
475
475
**Notes**:
476
476
- We used the normal `Chunker` in this example. Depending on the chunker you use, you will need to modify the `chunker_params` dictionary accordingly.
0 commit comments