Update Demo.py
Browse files
Demo.py
CHANGED
|
@@ -53,17 +53,12 @@ def create_pipeline(model):
|
|
| 53 |
.setInputCols(["document_table"])\
|
| 54 |
.setOutputCol("table")
|
| 55 |
|
| 56 |
-
|
| 57 |
-
.pretrained(
|
| 58 |
.setInputCols(["questions", "table"])\
|
| 59 |
.setOutputCol("answers_wtq")
|
| 60 |
-
|
| 61 |
-
tapas_sqa = TapasForQuestionAnswering\
|
| 62 |
-
.pretrained("table_qa_tapas_base_finetuned_sqa", "en")\
|
| 63 |
-
.setInputCols(["questions", "table"])\
|
| 64 |
-
.setOutputCol("answers_sqa")
|
| 65 |
|
| 66 |
-
pipeline = Pipeline(stages=[document_assembler, sentence_detector, table_assembler,
|
| 67 |
return pipeline
|
| 68 |
|
| 69 |
def fit_data(pipeline, json_data, question):
|
|
|
|
| 53 |
.setInputCols(["document_table"])\
|
| 54 |
.setOutputCol("table")
|
| 55 |
|
| 56 |
+
tapas = TapasForQuestionAnswering\
|
| 57 |
+
.pretrained(model, "en")\
|
| 58 |
.setInputCols(["questions", "table"])\
|
| 59 |
.setOutputCol("answers_wtq")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
pipeline = Pipeline(stages=[document_assembler, sentence_detector, table_assembler, tapas])
|
| 62 |
return pipeline
|
| 63 |
|
| 64 |
def fit_data(pipeline, json_data, question):
|