cardiffnlp/super_tweeteval
Viewer • Updated • 255k • 2.08k • 16
Run cardiffnlp/twitter-roberta-base-ner7-latest on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/cardiffnlp/twitter-roberta-base-ner7-latest. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/cardiffnlp/twitter-roberta-base-ner7-latest on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use cardiffnlp/twitter-roberta-base-ner7-latest with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("token-classification", model="cardiffnlp/twitter-roberta-base-ner7-latest") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForTokenClassification
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-ner7-latest")
model = AutoModelForTokenClassification.from_pretrained("cardiffnlp/twitter-roberta-base-ner7-latest", device_map="auto")This is a RoBERTa-large model trained on 154M tweets until the end of December 2022 and finetuned for topic Name Entity Recognition on the TweetNER7 dataset of SuperTweetEval. The original Twitter-based RoBERTa model can be found here.
"id2label": {
"0": "B-corporation",
"1": "B-creative_work",
"2": "B-event",
"3": "B-group",
"4": "B-location",
"5": "B-person",
"6": "B-product",
"7": "I-corporation",
"8": "I-creative_work",
"9": "I-event",
"10": "I-group",
"11": "I-location",
"12": "I-person",
"13": "I-product",
"14": "O"
}
from transformers import pipeline
text = "Halo Infinite analysis - The only true analysis {{USERNAME}} {{USERNAME}} {{USERNAME}} {{USERNAME}} {{USERNAME}} {{URL}}"
model_name = "cardiffnlp/twitter-roberta-base-ner7-latest"
pipe = pipeline('ner', model=model_name, tokenizer=model_name, aggregation_strategy="simple")
predictions = pipe(text)
predictions
>> [{'entity_group': 'creative_work',
'score': 0.5278398,
'word': 'Halo Infinite',
'start': 0,
'end': 13}]
Please cite the reference paper if you use this model.
@inproceedings{antypas2023supertweeteval,
title={SuperTweetEval: A Challenging, Unified and Heterogeneous Benchmark for Social Media NLP Research},
author={Dimosthenis Antypas and Asahi Ushio and Francesco Barbieri and Leonardo Neves and Kiamehr Rezaee and Luis Espinosa-Anke and Jiaxin Pei and Jose Camacho-Collados},
booktitle={Findings of the Association for Computational Linguistics: EMNLP 2023},
year={2023}
}