| # Use a pipeline as a high-level helper | |
| from transformers import pipeline | |
| import streamlit as st | |
| import pandas as pd | |
| pipe = pipeline("table-question-answering", model="google/tapas-large-finetuned-wtq") | |
| st.title('Query your data with text') | |
| file = st.file_uploader('Upload a csv file here') | |
| if file is not None: | |
| query = st.text_input('Query') | |
| data = pd.read_csv(file) | |
| st.subheader('Data') | |
| st.table(data.head()) | |
| if query: | |
| st.write(pipe(table=data, query=query)) | |