The historical multilingual named entity linking (NEL) model is based on mGENRE (multilingual Generative ENtity REtrieval) system as presented in
Multilingual Autoregressive Entity Linking
. mGENRE uses a sequence-to-sequence approach to entity retrieval (e.g., linking), based on finetuned
mBART
architecture.
GENRE performs retrieval generating the unique entity name conditioned on the input text using constrained beam search to only generate valid identifiers.
This model was finetuned on the
HIPE-2022 dataset
, composed of the following datasets.
Here is an example of generation for Wikipedia page disambiguation:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("impresso-project/nel-hipe-multilingual")
model = AutoModelForSeq2SeqLM.from_pretrained("impresso-project/nel-hipe-multilingual").eval()
sentences = ["[START] United Press [END] - On the home front, the British populace remains steadfast in the face of ongoing air raids.",
"In [START] London [END], trotz der Zerstörung, ist der Geist der Menschen ungebrochen, mit Freiwilligen und zivilen Verteidigungseinheiten, die unermüdlich arbeiten, um die Kriegsanstrengungen zu unterstützen.",
"Les rapports des correspondants de la [START] AFP [END] mettent en lumière la poussée nationale pour augmenter la production dans les usines, essentielle pour fournir au front les matériaux nécessaires à la victoire."]
for sentence in sentences:
outputs = model.generate(
**tokenizer([sentence], return_tensors="pt"),
num_beams=5,
num_return_sequences=5
)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
which outputs the following top-5 predictions (using constrained beam search)
['United Press International >> en ', 'The United Press International >> en ', 'United Press International >> de ', 'United Press >> en ', 'Associated Press >> en ']
['London >> de ', 'London >> de ', 'London >> de ', 'Stadt London >> de ', 'Londonderry >> de ']
['Agence France-Presse >> fr ', 'Agence France-Presse >> fr ', 'Agence France-Presse de la Presse écrite >> fr ', 'Agence France-Presse de la porte de Vincennes >> fr ', 'Agence France-Presse de la porte océanique >> fr ']
Example with simulated OCR noise:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("impresso-project/nel-hipe-multilingual")
model = AutoModelForSeq2SeqLM.from_pretrained("impresso-project/nel-hipe-multilingual").eval()
sentences = ["[START] Un1ted Press [END] - On the h0me fr0nt, the British p0pulace remains steadfast in the f4ce of 0ngoing air raids.",
"In [START] Lon6on [END], trotz d3r Zerstörung, ist der Geist der M3nschen ungeb4ochen, mit Freiwilligen und zivilen Verteidigungseinheiten, die unermüdlich arbeiten, um die Kriegsanstrengungen zu unterstützen.",
"Les rapports des correspondants de la [START] AFP [END] mettent en lumiére la poussée nationale pour augmenter la production dans les usines, essentielle pour fournir au front les matériaux nécessaires à la victoire."]
for sentence in sentences:
outputs = model.generate(
**tokenizer([sentence], return_tensors="pt"),
num_beams=5,
num_return_sequences=5
)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
['United Press International >> en ', 'Un1ted Press >> en ', 'Joseph Bradley Varnum >> en ', 'The Press >> en ', 'The Unused Press >> en ']
['London >> de ', 'Longbourne >> de ', 'Longbon >> de ', 'Longston >> de ', 'Lyon >> de ']
['Agence France-Presse >> fr ', 'Agence France-Presse >> fr ', 'Agence France-Presse de la Presse écrite >> fr ', 'Agence France-Presse de la porte de Vincennes >> fr ', 'Agence France-Presse de la porte océanique >> fr ']
license: agpl-3.0
Runs of impresso-project nel-mgenre-multilingual on huggingface.co
194
Total runs
0
24-hour runs
14
3-day runs
91
7-day runs
50
30-day runs
More Information About nel-mgenre-multilingual huggingface.co Model
nel-mgenre-multilingual huggingface.co is an AI model on huggingface.co that provides nel-mgenre-multilingual's model effect (), which can be used instantly with this impresso-project nel-mgenre-multilingual model. huggingface.co supports a free trial of the nel-mgenre-multilingual model, and also provides paid use of the nel-mgenre-multilingual. Support call nel-mgenre-multilingual model through api, including Node.js, Python, http.
nel-mgenre-multilingual huggingface.co is an online trial and call api platform, which integrates nel-mgenre-multilingual's modeling effects, including api services, and provides a free online trial of nel-mgenre-multilingual, you can try nel-mgenre-multilingual online for free by clicking the link below.
impresso-project nel-mgenre-multilingual online free url in huggingface.co:
nel-mgenre-multilingual is an open source model from GitHub that offers a free installation service, and any user can find nel-mgenre-multilingual on GitHub to install. At the same time, huggingface.co provides the effect of nel-mgenre-multilingual install, users can directly use nel-mgenre-multilingual installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
nel-mgenre-multilingual install url in huggingface.co: