Downloads · 30 days
9
0% of all-time downloads
olgaduchovny/t5-base-ner-mit-movie
t5-base-ner-mit-movie is a machine learning model from olgaduchovny. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Unofficial implementation of InstructionNER. t5-base model tuned on conll2003 dataset.
Downloads · 30 days
9
0% of all-time downloads
All-time downloads
4.1K
Public
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.bin892 MB · 100%
From the Hugging Face model README
Unofficial implementation of InstructionNER. t5-base model tuned on conll2003 dataset.
https://github.com/ovbystrova/InstructionNER
git clone https://github.com/ovbystrova/InstructionNER
cd InstructionNER
from instruction_ner.model import Model
model = Model(
model_path_or_name="olgaduchovny/t5-base-ner-mit-movie",
tokenizer_path_or_name="olgaduchovny/t5-base-ner-mit-movie"
)
options = [
"ACTOR",
"AWARD",
"CHARACTER",
"DIRECTOR",
"GENRE",
"OPINION",
"ORIGIN",
"PLOT",
"QUOTE",
"RELATIONSHIP",
"SOUNDTRACK",
"YEAR"
]
instruction = "please extract entities and their types from the input sentence, " \
"all entity types are in options"
text = "are there any good romantic comedies out right now"
generation_kwargs = {
"num_beams": 2,
"max_length": 128
}
pred_spans = model.predict(
text=text,
generation_kwargs=generation_kwargs,
instruction=instruction,
options=options
)
>>> [(19, 36, 'GENRE'), (41, 50, 'YEAR')]