Spaces:
Build error
Build error
Commit
·
ab23d72
1
Parent(s):
99e4f59
removed empty_df during fitting process
Browse files
app.py
CHANGED
@@ -261,26 +261,24 @@ def build_pipeline(text, model_name=selected_model):
|
|
261 |
])
|
262 |
|
263 |
|
264 |
-
|
265 |
|
266 |
if model_name=="nerdl_fewnerd_100d":
|
267 |
-
pipeline_model= fewnerd_pipeline.fit(
|
268 |
|
269 |
elif model_name=="ner_conll_elmo":
|
270 |
-
pipeline_model= elmo_pipeline.fit(
|
271 |
|
272 |
elif model_name=="ner_mit_movie_complex_distilbert_base_cased":
|
273 |
-
pipeline_model= movie_pipeline.fit(
|
274 |
|
275 |
elif model_name=="ner_conll_albert_large_uncased":
|
276 |
-
pipeline_model= albert_pipeline.fit(
|
277 |
|
278 |
elif model_name=="onto_100":
|
279 |
-
pipeline_model= onto_pipeline.fit(
|
280 |
|
281 |
-
|
282 |
-
text_df= spark.createDataFrame(pd.DataFrame({"text": [text]}))
|
283 |
-
result= pipeline_model.transform(text_df).toPandas()
|
284 |
|
285 |
return result
|
286 |
|
|
|
261 |
])
|
262 |
|
263 |
|
264 |
+
text_df = spark.createDataFrame([[text]]).toDF("text")
|
265 |
|
266 |
if model_name=="nerdl_fewnerd_100d":
|
267 |
+
pipeline_model= fewnerd_pipeline.fit(text_df)
|
268 |
|
269 |
elif model_name=="ner_conll_elmo":
|
270 |
+
pipeline_model= elmo_pipeline.fit(text_df)
|
271 |
|
272 |
elif model_name=="ner_mit_movie_complex_distilbert_base_cased":
|
273 |
+
pipeline_model= movie_pipeline.fit(text_df)
|
274 |
|
275 |
elif model_name=="ner_conll_albert_large_uncased":
|
276 |
+
pipeline_model= albert_pipeline.fit(text_df)
|
277 |
|
278 |
elif model_name=="onto_100":
|
279 |
+
pipeline_model= onto_pipeline.fit(text_df)
|
280 |
|
281 |
+
result = pipeline_model.transform(text_df).toPandas()
|
|
|
|
|
282 |
|
283 |
return result
|
284 |
|