remove rest txt
Browse files
app.py
CHANGED
@@ -61,28 +61,4 @@ if st.button('Run QA inference (get answer prediction)'):
|
|
61 |
st.write(answer)
|
62 |
else:
|
63 |
st.write('Write some passage of text and a question')
|
64 |
-
st.stop()
|
65 |
-
|
66 |
-
|
67 |
-
"""
|
68 |
-
from transformers import pipeline
|
69 |
-
|
70 |
-
x = st.slider('Select a value')
|
71 |
-
st.write(x, 'squared is', x * x)
|
72 |
-
|
73 |
-
question_answerer = pipeline("question-answering")
|
74 |
-
|
75 |
-
context = r" Extractive Question Answering is the task of extracting an answer from a text given a question.
|
76 |
-
An example of a question answering dataset is the SQuAD dataset, which is entirely based on that task.
|
77 |
-
If you would like to fine-tune a model on a SQuAD task, you may leverage the
|
78 |
-
examples/pytorch/question-answering/run_squad.py script."
|
79 |
-
question = "What is extractive question answering?" #"What is a good example of a question answering dataset?"
|
80 |
-
result = question_answerer(question=question, context=context)
|
81 |
-
answer = result['answer']
|
82 |
-
score = round(result['score'], 4)
|
83 |
-
span = f"start: {result['start']}, end: {result['end']}"
|
84 |
-
|
85 |
-
st.write(answer)
|
86 |
-
st.write(f"score: {score}")
|
87 |
-
st.write(f"span: {span}")
|
88 |
-
"""
|
|
|
61 |
st.write(answer)
|
62 |
else:
|
63 |
st.write('Write some passage of text and a question')
|
64 |
+
st.stop()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|