poccio commited on
Commit
2b81d2f
1 Parent(s): bb04844

initial commit

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -18,9 +18,9 @@ def main(
18
  ):
19
  # setup examples
20
  examples = [
21
- "Rome is in Italy",
22
  "Japan began the defence of their title with a lucky 2-1 win against Syria in a Group C championship match on Friday.",
23
  "The project was coded in Java.",
 
24
  ]
25
 
26
  # define load_resources
@@ -157,7 +157,7 @@ def main(
157
  while t.idx + len(t) != _end:
158
  t = next(it)
159
  annotated_html_components.append(
160
- str(annotation(*(_text, _entity, color_generator())))
161
  )
162
  else:
163
  annotated_html_components.append(str(html.escape(t.text)))
 
18
  ):
19
  # setup examples
20
  examples = [
 
21
  "Japan began the defence of their title with a lucky 2-1 win against Syria in a Group C championship match on Friday.",
22
  "The project was coded in Java.",
23
+ "Rome is in Italy",
24
  ]
25
 
26
  # define load_resources
 
157
  while t.idx + len(t) != _end:
158
  t = next(it)
159
  annotated_html_components.append(
160
+ f"<a href=\"https://en.wikipedia.org/wiki/{_entity.lower().replace(' ', '_').capitalize()}\">{annotation(*(_text, _entity, color_generator()))}</a>"
161
  )
162
  else:
163
  annotated_html_components.append(str(html.escape(t.text)))