emanuelaboros commited on
Commit
bf5f745
·
1 Parent(s): 69a7750

lets see how the hihgt works

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -67,8 +67,13 @@ def extract_entities(sentence):
67
  entity["start"] : entity["end"]
68
  ].strip() # Ensure we're working with the correct portion of the text
69
  entity["surface"] = entity_text
70
- label = f"{entity['type']} ({entity.get('title', 'No title')}, {entity.get('name', 'No name')}, {entity.get('function', 'No function')})"
71
-
 
 
 
 
 
72
  entity["entity"] = label
73
  # print(f"Entity text: {entity}")
74
 
 
67
  entity["start"] : entity["end"]
68
  ].strip() # Ensure we're working with the correct portion of the text
69
  entity["surface"] = entity_text
70
+ label = f"{entity['type']}"
71
+ if "title" in entity:
72
+ label += f" - Title: {entity['title']}"
73
+ if "name" in entity:
74
+ label += f" - Name: {entity['name']}"
75
+ if "function" in entity:
76
+ label += f" - Function: {entity['function']}"
77
  entity["entity"] = label
78
  # print(f"Entity text: {entity}")
79