A multi-task model for named-entity recognition, relation extraction, entity mention detection, and coreference resolution.
We model NER as a span classification task and relation extraction as a multi-label classification of (NER) span tuples.
Similarly, model EMD as a span classification task and CR as a binary classification of (EMD) span tuples.
To construct the CR clusters, we keep the top antecedent of each mention, then compute the connected components of the mentions' undirected graph.
import json
from transformers import AutoTokenizer
from corener.models import Corener, ModelOutput
from corener.data import MTLDataset
from corener.utils.prediction import convert_model_output
tokenizer = AutoTokenizer.from_pretrained("aiola/roberta-large-corener")
model = Corener.from_pretrained("aiola/roberta-large-corener")
model.eval()
examples = [
"Apple Park is the corporate headquarters of Apple Inc., located in Cupertino, California, United States. It was opened to employees in April 2017, while construction was still underway, and superseded the original headquarters at 1 Infinite Loop, which opened in 1993."
]
dataset = MTLDataset(
types=model.config.types,
tokenizer=tokenizer,
train_mode=False,
)
dataset.read_dataset(examples)
example = dataset.get_example(0) # get first example
output: ModelOutput = model(
input_ids=example.encodings,
context_masks=example.context_masks,
entity_masks=example.entity_masks,
entity_sizes=example.entity_sizes,
entity_spans=example.entity_spans,
entity_sample_masks=example.entity_sample_masks,
inference=True,
)
print(json.dumps(convert_model_output(output=output, batch=example, dataset=dataset), indent=2))
Runs of aiola roberta-large-corener on huggingface.co
23
Total runs
-10
24-hour runs
-10
3-day runs
-4
7-day runs
14
30-day runs
More Information About roberta-large-corener huggingface.co Model
roberta-large-corener huggingface.co is an AI model on huggingface.co that provides roberta-large-corener's model effect (), which can be used instantly with this aiola roberta-large-corener model. huggingface.co supports a free trial of the roberta-large-corener model, and also provides paid use of the roberta-large-corener. Support call roberta-large-corener model through api, including Node.js, Python, http.
roberta-large-corener huggingface.co is an online trial and call api platform, which integrates roberta-large-corener's modeling effects, including api services, and provides a free online trial of roberta-large-corener, you can try roberta-large-corener online for free by clicking the link below.
aiola roberta-large-corener online free url in huggingface.co:
roberta-large-corener is an open source model from GitHub that offers a free installation service, and any user can find roberta-large-corener on GitHub to install. At the same time, huggingface.co provides the effect of roberta-large-corener install, users can directly use roberta-large-corener installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
roberta-large-corener install url in huggingface.co: