Update Demo.py
Browse files
Demo.py
CHANGED
|
@@ -66,13 +66,6 @@ def create_pipeline(model):
|
|
| 66 |
pipeline = Pipeline(stages=[document_assembler, sentence_detector, table_assembler, tapas_wtq, tapas_sqa])
|
| 67 |
return pipeline
|
| 68 |
|
| 69 |
-
def fit_data(pipeline, data):
|
| 70 |
-
empty_df = spark.createDataFrame([['']]).toDF('text')
|
| 71 |
-
pipeline_model = pipeline.fit(empty_df)
|
| 72 |
-
model = LightPipeline(pipeline_model)
|
| 73 |
-
result = model.fullAnnotate(data)
|
| 74 |
-
return result
|
| 75 |
-
|
| 76 |
def fit_data(pipeline, json_data, question):
|
| 77 |
spark_df = spark.createDataFrame([[json_data, question]]).toDF("table_json", "questions")
|
| 78 |
model = pipeline.fit(spark_df)
|
|
|
|
| 66 |
pipeline = Pipeline(stages=[document_assembler, sentence_detector, table_assembler, tapas_wtq, tapas_sqa])
|
| 67 |
return pipeline
|
| 68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
def fit_data(pipeline, json_data, question):
|
| 70 |
spark_df = spark.createDataFrame([[json_data, question]]).toDF("table_json", "questions")
|
| 71 |
model = pipeline.fit(spark_df)
|