Spaces:
Paused
Paused
Davide Fiocco
commited on
Commit
·
4bed6fd
1
Parent(s):
dcf6f0c
Make isort/black happy
Browse files- app.py +0 -1
- test_answers.py +4 -2
- utils.py +3 -2
app.py
CHANGED
@@ -35,7 +35,6 @@ with st.spinner(
|
|
35 |
engine = load_engine()
|
36 |
|
37 |
|
38 |
-
|
39 |
st.title("Le risposte alle tue domande personali")
|
40 |
|
41 |
input = st.text_input("Scrivi una domanda in italiano e comparirà la risposta!")
|
|
|
35 |
engine = load_engine()
|
36 |
|
37 |
|
|
|
38 |
st.title("Le risposte alle tue domande personali")
|
39 |
|
40 |
input = st.text_input("Scrivi una domanda in italiano e comparirà la risposta!")
|
test_answers.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
-
from utils import get_answer
|
2 |
-
from transformers import pipeline
|
3 |
import json
|
4 |
|
|
|
|
|
|
|
|
|
5 |
nlp_qa = pipeline(
|
6 |
"question-answering",
|
7 |
model="mrm8488/bert-italian-finedtuned-squadv1-it-alfa",
|
|
|
|
|
|
|
1 |
import json
|
2 |
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
from utils import get_answer
|
6 |
+
|
7 |
nlp_qa = pipeline(
|
8 |
"question-answering",
|
9 |
model="mrm8488/bert-italian-finedtuned-squadv1-it-alfa",
|
utils.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
-
import json
|
2 |
import datetime
|
|
|
|
|
3 |
|
4 |
def get_answer(input, context, engine):
|
5 |
|
@@ -15,4 +16,4 @@ def get_context():
|
|
15 |
with open("context.json") as f:
|
16 |
context = json.load(f)["info"].replace("[YEAR]", str(now.year))
|
17 |
|
18 |
-
return context
|
|
|
|
|
1 |
import datetime
|
2 |
+
import json
|
3 |
+
|
4 |
|
5 |
def get_answer(input, context, engine):
|
6 |
|
|
|
16 |
with open("context.json") as f:
|
17 |
context = json.load(f)["info"].replace("[YEAR]", str(now.year))
|
18 |
|
19 |
+
return context
|