ArneBinder commited on
Commit
7c8f86e
1 Parent(s): 47a773b

adjust for recent version of pytorch-ie

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -27,12 +27,12 @@ re_pipeline = AutoPipeline.from_pretrained(re_model_name_or_path, device=-1, num
27
  def predict(text):
28
  document = ExampleDocument(text)
29
 
30
- ner_pipeline(document, predict_field="entities")
31
 
32
  for entity in document.entities.predictions:
33
  document.entities.append(entity)
34
 
35
- re_pipeline(document, predict_field="relations")
36
 
37
  t = PrettyTable()
38
  t.field_names = ["head", "tail", "relation"]
 
27
  def predict(text):
28
  document = ExampleDocument(text)
29
 
30
+ ner_pipeline(document)
31
 
32
  for entity in document.entities.predictions:
33
  document.entities.append(entity)
34
 
35
+ re_pipeline(document)
36
 
37
  t = PrettyTable()
38
  t.field_names = ["head", "tail", "relation"]