Upload folder using huggingface_hub
Browse files- tools/squad_tools.py +5 -7
tools/squad_tools.py
CHANGED
@@ -4,14 +4,13 @@ from data import get_data
|
|
4 |
class SquadRetrieverTool(Tool):
|
5 |
name = "squad_retriever"
|
6 |
description = """Retrieves documents from the Stanford Question Answering Dataset (SQuAD).
|
7 |
-
Because this tool does not remember context from previous queries, be sure to include
|
8 |
-
|
9 |
-
not support negative queries, so only query for what you want, not what you don't want.
|
10 |
"""
|
11 |
inputs = {
|
12 |
"query": {
|
13 |
"type": "string",
|
14 |
-
"description": "The query.
|
15 |
},
|
16 |
}
|
17 |
output_type = "string"
|
@@ -40,11 +39,11 @@ class SquadQueryTool(Tool):
|
|
40 |
name = "squad_query"
|
41 |
description = """Attempts to answer a question using the Stanford Question Answering Dataset (SQuAD).
|
42 |
Because this tool does not remember context from previous queries, be sure to include
|
43 |
-
|
44 |
inputs = {
|
45 |
"query": {
|
46 |
"type": "string",
|
47 |
-
"description": "The question.
|
48 |
},
|
49 |
}
|
50 |
output_type = "string"
|
@@ -58,7 +57,6 @@ class SquadQueryTool(Tool):
|
|
58 |
assert isinstance(query, str), "Your search query must be a string"
|
59 |
|
60 |
response = self.query_engine.query(query)
|
61 |
-
# docs = self.data.index.similarity_search(query, k=3)
|
62 |
|
63 |
if len(response.response) == 0:
|
64 |
return "No answer found for this query."
|
|
|
4 |
class SquadRetrieverTool(Tool):
|
5 |
name = "squad_retriever"
|
6 |
description = """Retrieves documents from the Stanford Question Answering Dataset (SQuAD).
|
7 |
+
Because this tool does not remember context from previous queries, be sure to include
|
8 |
+
as many details as possible in your query.
|
|
|
9 |
"""
|
10 |
inputs = {
|
11 |
"query": {
|
12 |
"type": "string",
|
13 |
+
"description": "The query. Be sure to pass this as a keyword argument and not a dictionary.",
|
14 |
},
|
15 |
}
|
16 |
output_type = "string"
|
|
|
39 |
name = "squad_query"
|
40 |
description = """Attempts to answer a question using the Stanford Question Answering Dataset (SQuAD).
|
41 |
Because this tool does not remember context from previous queries, be sure to include
|
42 |
+
as many details as possible in your query."""
|
43 |
inputs = {
|
44 |
"query": {
|
45 |
"type": "string",
|
46 |
+
"description": "The question. Be sure to pass this as a keyword argument and not a dictionary.",
|
47 |
},
|
48 |
}
|
49 |
output_type = "string"
|
|
|
57 |
assert isinstance(query, str), "Your search query must be a string"
|
58 |
|
59 |
response = self.query_engine.query(query)
|
|
|
60 |
|
61 |
if len(response.response) == 0:
|
62 |
return "No answer found for this query."
|