emanuelaboros commited on
Commit
ac76025
·
1 Parent(s): 1a30cc1

update app

Browse files
Files changed (1) hide show
  1. app.py +39 -23
app.py CHANGED
@@ -102,8 +102,7 @@ def disambiguate_sentence(sentence):
102
  return "No entity found."
103
 
104
  # Create an HTML output with a clickable link
105
- entity_info = f"""
106
- <div>
107
  <strong>Entity:</strong> {title} <br>
108
  <strong>QID:</strong> {qid} <br>
109
  <a href="{url}" target="_blank">Wikipedia Page</a>
@@ -116,10 +115,7 @@ def nel_app_interface():
116
  input_sentence = gr.Textbox(
117
  lines=5,
118
  label="Input Sentence",
119
- placeholder="Enter your sentence here in the following format: // << We are going to [START] Paris [END]. >>"
120
- " // This format ensures that the model knows which entities to disambiguate, more exactly the "
121
- "entity should be surrounded by `[START]` and `[END]`. // "
122
- "!Only one entity per sentence is supported at the moment!",
123
  )
124
  output_entities = gr.HTML(label="Linked Entity")
125
 
@@ -129,25 +125,45 @@ def nel_app_interface():
129
  inputs=input_sentence,
130
  outputs=output_entities,
131
  title="Entity Linking with impresso-project/nel-hipe-multilingual",
132
- description="Link entities using the `impresso-project/nel-hipe-multilingual` model under the hood!",
 
 
 
 
 
 
133
  examples=[
134
  [
135
- "Des chercheurs de l' [START] Université de Cambridge [END] ont développé une nouvelle technique de calcul "
136
- "quantique qui promet d'augmenter exponentiellement les vitesses de calcul.",
137
- "Le rapport complet sur ces découvertes a été publié dans la prestigieuse revue 'Nature Physics'. ([START] "
138
- "Reuters [END])",
139
- "In the [START] year 1789 [END], the Estates-General was convened in France.",
140
- "[START] King Louis XVI, ruler of France [END], called for the meeting.",
141
- "The event was held at the [START] Palace of Versailles [END], a symbol of French monarchy.",
142
- "At Versailles, Marie Antoinette, the Queen of France, was involved in discussions.",
143
- "Maximilien Robespierre, a leading member of the National Assembly, also participated.",
144
- "[START] Jean-Jacques Rousseau, the famous philosopher [END], was a significant figure in the debate.",
145
- "Another important participant was [START] Charles de Talleyrand, the Bishop of Autun [END].",
146
- "Meanwhile, across the Atlantic, [START] George Washington, the first President of the United States [END], "
147
- "was shaping policies.",
148
- "[START] Thomas Jefferson, the nation's Secretary of State [END], played a key role in drafting policies for "
149
- "the new American government.",
150
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  ],
152
  )
153
 
 
102
  return "No entity found."
103
 
104
  # Create an HTML output with a clickable link
105
+ entity_info = f"""<div>
 
106
  <strong>Entity:</strong> {title} <br>
107
  <strong>QID:</strong> {qid} <br>
108
  <a href="{url}" target="_blank">Wikipedia Page</a>
 
115
  input_sentence = gr.Textbox(
116
  lines=5,
117
  label="Input Sentence",
118
+ placeholder="Enter your sentence here:",
 
 
 
119
  )
120
  output_entities = gr.HTML(label="Linked Entity")
121
 
 
125
  inputs=input_sentence,
126
  outputs=output_entities,
127
  title="Entity Linking with impresso-project/nel-hipe-multilingual",
128
+ description="Link entities using the `impresso-project/nel-hipe-multilingual` model under the hood! "
129
+ "We recommend using shorter texts (ie sentences, not full paragraphs). "
130
+ "The sentences in the following format: "
131
+ "<< We are going to [START] Paris [END].>> "
132
+ "This format ensures that the model knows which entities to disambiguate, more exactly the "
133
+ "entity should be surrounded by `[START]` and `[END]`."
134
+ "Warning: Only one entity per sentence is supported at the moment!",
135
  examples=[
136
  [
137
+ "Des chercheurs de l' [START] Université de Cambridge [END] ont développé une nouvelle technique de calcul quantique qui promet d'augmenter exponentiellement les vitesses de calcul."
138
+ ],
139
+ [
140
+ "Le rapport complet sur ces découvertes a été publié dans la prestigieuse revue 'Nature Physics'. ([START] Reuters [END])"
141
+ ],
142
+ [
143
+ "In the [START] year 1789 [END], the Estates-General was convened in France."
144
+ ],
145
+ ["[START] King Louis XVI, ruler of France [END], called for the meeting."],
146
+ [
147
+ "The event was held at the [START] Palace of Versailles [END], a symbol of French monarchy."
148
+ ],
149
+ [
150
+ "At Versailles, Marie Antoinette, the Queen of France, was involved in discussions."
151
+ ],
152
+ [
153
+ "Maximilien Robespierre, a leading member of the National Assembly, also participated."
154
+ ],
155
+ [
156
+ "[START] Jean-Jacques Rousseau, the famous philosopher [END], was a significant figure in the debate."
157
+ ],
158
+ [
159
+ "Another important participant was [START] Charles de Talleyrand, the Bishop of Autun [END]."
160
+ ],
161
+ [
162
+ "Meanwhile, across the Atlantic, [START] George Washington, the first President of the United States [END], was shaping policies."
163
+ ],
164
+ [
165
+ "[START] Thomas Jefferson, the nation's Secretary of State [END], played a key role in drafting policies for the new American government."
166
+ ],
167
  ],
168
  )
169