Spaces:
Running
Running
fschwartzer
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,12 +3,12 @@ import pandas as pd
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
df = pd.read_excel('discrepantes.xlsx', index_col='Unnamed: 0')
|
|
|
|
|
|
|
6 |
|
7 |
-
def response(user_question):
|
8 |
tqa = pipeline(task="table-question-answering", model="google/tapas-large-finetuned-wtq")
|
9 |
-
df.fillna(0, inplace=True)
|
10 |
-
table_data = df.astype(str)
|
11 |
-
print(table_data.head())
|
12 |
resposta = tqa(table=table_data , query=user_question)['cells'][0]
|
13 |
return resposta
|
14 |
|
|
|
3 |
from transformers import pipeline
|
4 |
|
5 |
df = pd.read_excel('discrepantes.xlsx', index_col='Unnamed: 0')
|
6 |
+
df.fillna(0, inplace=True)
|
7 |
+
table_data = df.astype(str)
|
8 |
+
print(table_data.head())
|
9 |
|
10 |
+
def response(user_question, table_data):
|
11 |
tqa = pipeline(task="table-question-answering", model="google/tapas-large-finetuned-wtq")
|
|
|
|
|
|
|
12 |
resposta = tqa(table=table_data , query=user_question)['cells'][0]
|
13 |
return resposta
|
14 |
|