Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,7 +87,7 @@ def bert_question_answering_v1(context, question):
|
|
| 87 |
# Define question_answering_spanish for ConfliBERT-Spanish-Beto-Cased-NewsQA
|
| 88 |
def question_answering_spanish(context, question):
|
| 89 |
try:
|
| 90 |
-
inputs = confli_tokenizer_spanish(question, context, return_tensors='tf', truncation=True)
|
| 91 |
outputs = confli_model_spanish(inputs)
|
| 92 |
answer_start = tf.argmax(outputs.start_logits, axis=1).numpy()[0]
|
| 93 |
answer_end = tf.argmax(outputs.end_logits, axis=1).numpy()[0] + 1
|
|
@@ -101,7 +101,7 @@ def question_answering_spanish(context, question):
|
|
| 101 |
# Define beto_question_answering_spanish for Beto-Spanish-Cased-NewsQA
|
| 102 |
def beto_question_answering_spanish(context, question):
|
| 103 |
try:
|
| 104 |
-
inputs = beto_tokenizer_spanish(question, context, return_tensors='tf', truncation=True)
|
| 105 |
outputs = beto_model_spanish(inputs)
|
| 106 |
answer_start = tf.argmax(outputs.start_logits, axis=1).numpy()[0]
|
| 107 |
answer_end = tf.argmax(outputs.end_logits, axis=1).numpy()[0] + 1
|
|
|
|
| 87 |
# Define question_answering_spanish for ConfliBERT-Spanish-Beto-Cased-NewsQA
|
| 88 |
def question_answering_spanish(context, question):
|
| 89 |
try:
|
| 90 |
+
inputs = confli_tokenizer_spanish.encode_plus(question, context, return_tensors='tf', truncation=True)
|
| 91 |
outputs = confli_model_spanish(inputs)
|
| 92 |
answer_start = tf.argmax(outputs.start_logits, axis=1).numpy()[0]
|
| 93 |
answer_end = tf.argmax(outputs.end_logits, axis=1).numpy()[0] + 1
|
|
|
|
| 101 |
# Define beto_question_answering_spanish for Beto-Spanish-Cased-NewsQA
|
| 102 |
def beto_question_answering_spanish(context, question):
|
| 103 |
try:
|
| 104 |
+
inputs = beto_tokenizer_spanish.encode_plus(question, context, return_tensors='tf', truncation=True)
|
| 105 |
outputs = beto_model_spanish(inputs)
|
| 106 |
answer_start = tf.argmax(outputs.start_logits, axis=1).numpy()[0]
|
| 107 |
answer_end = tf.argmax(outputs.end_logits, axis=1).numpy()[0] + 1
|