emanuelaboros commited on
Commit
98c3feb
·
1 Parent(s): 23365f5

update app

Browse files
Files changed (1) hide show
  1. app.py +31 -15
app.py CHANGED
@@ -20,19 +20,35 @@ def disambiguate_sentences(sentences):
20
  return results
21
 
22
 
23
- input_sentences = gr.inputs.Textbox(
24
- lines=5,
25
- label="Input Sentences",
26
- placeholder="Enter your sentence here in the following format: \\ `It is reported in [START] Paris [END], "
27
- "that the opening of the chambers will take place on the 27th January.' \\ "
28
- "This format ensures that the model knows which entities to disambiguate, more exactly the entity should "
29
- "be surrounded by `[START]` and `[END]`.",
30
- )
31
- output_predictions = gr.outputs.Textbox(label="Predictions")
32
-
33
- gr.Interface(
34
  fn=disambiguate_sentences,
35
- inputs=input_sentences,
36
- outputs=output_predictions,
37
- title="NEL Disambiguation",
38
- ).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  return results
21
 
22
 
23
+ demo = gr.Interface(
 
 
 
 
 
 
 
 
 
 
24
  fn=disambiguate_sentences,
25
+ inputs=[
26
+ gr.Textbox(
27
+ label="Input Sentences:",
28
+ lines=5,
29
+ placeholder="Enter your sentence here in the following format: \\ `It is reported in [START] Paris [END], "
30
+ "that the opening of the chambers will take place on the 27th January.' \\ "
31
+ "This format ensures that the model knows which entities to disambiguate, more exactly the entity should "
32
+ "be surrounded by `[START]` and `[END]`.",
33
+ )
34
+ ],
35
+ outputs=[gr.outputs.Textbox(label="Predictions")],
36
+ title="Entity Linking with impresso-project/nel-hipe-multilingual",
37
+ description="Link entities using the `impresso-project/nel-hipe-multilingual` model under the hood!",
38
+ allow_flagging="never",
39
+ # Here we introduce a new tag, examples, easy to use examples for your application
40
+ examples=[
41
+ "Des chercheurs de l' [START] Université de Cambridge [END] ont développé une nouvelle technique de calcul quantique qui "
42
+ "promet d'augmenter exponentiellement les vitesses de calcul. Cette percée, décrite comme un 'bond quantique' "
43
+ "dans la technologie informatique, pourrait ouvrir la voie à des capacités de traitement de données "
44
+ "ultra-rapides et sécurisées. Le rapport complet sur ces découvertes a été publié dans la "
45
+ "prestigieuse revue 'Nature Physics'. ([START] Reuters [END])",
46
+ "In the [START] year 1789 [END], [START] King Louis XVI, ruler of France [END], convened the Estates-General at the [START] Palace of Versailles [END], "
47
+ "where Marie Antoinette, the Queen of France, alongside Maximilien Robespierre, a leading member of the National Assembly, "
48
+ "debated with [START] Jean-Jacques Rousseau, the famous philosopher [END], and [START] Charles de Talleyrand, the Bishop of Autun [END], "
49
+ "regarding the future of the French monarchy. At the same time, across the Atlantic in Philadelphia, "
50
+ "[START] George Washington, the first President of the United States [END], and [START] Thomas Jefferson, the nation's Secretary of State [END], "
51
+ "were drafting policies for the newly established American government following the signing of the Constitution.",
52
+ ],
53
+ )
54
+ demo.launch()