cardiffnlp / tweet-topic-large-multilingual

huggingface.co
Total runs: 31
24-hour runs: 0
7-day runs: 19
30-day runs: 19
Model's Last Updated: November 26 2024
text-classification

Introduction of tweet-topic-large-multilingual

Model Details of tweet-topic-large-multilingual

tweet-topic-large-multilingual

This model is based on cardiffnlp/twitter-xlm-roberta-large-2022 language model and isfinetuned for multi-label topic classification in English, Spanish, Japanese, and Greek.

The models is trained using TweetTopic and X-Topic datasets.

Labels :

0: arts_&_culture 5: fashion_&_style 10: learning_&_educational 15: science_&_technology
1: business_&_entrepreneurs 6: film_tv_&_video 11: music 16: sports
2: celebrity_&_pop_culture 7: fitness_&_health 12: news_&_social_concern 17: travel_&_adventure
3: diaries_&_daily_life 8: food_&_dining 13: other_hobbies 18: youth_&_student_life
4: family 9: gaming 14: relationships
Full classification example
from transformers import AutoModelForSequenceClassification, TFAutoModelForSequenceClassification
from transformers import AutoTokenizer
import numpy as np
from scipy.special import expit

    
MODEL = f"cardiffnlp/tweet-topic-large-multilingual"
tokenizer = AutoTokenizer.from_pretrained(MODEL)

# PT
model = AutoModelForSequenceClassification.from_pretrained(MODEL)
class_mapping = model.config.id2label

text = "It is great to see athletes promoting awareness for climate change."
tokens = tokenizer(text, return_tensors='pt')
output = model(**tokens)

scores = output[0][0].detach().numpy()
scores = expit(scores)
predictions = (scores >= 0.5) * 1


# TF
#tf_model = TFAutoModelForSequenceClassification.from_pretrained(MODEL)
#class_mapping = tf_model.config.id2label
#text = "It is great to see athletes promoting awareness for climate change."
#tokens = tokenizer(text, return_tensors='tf')
#output = tf_model(**tokens)
#scores = output[0][0]
#scores = expit(scores)
#predictions = (scores >= 0.5) * 1

# Map to classes
for i in range(len(predictions)):
  if predictions[i]:
    print(class_mapping[i])

Output:

news_&_social_concern
sports
Results on X-Topic
English Spanish Japanese Greek
Macro-F1 60.2 52.9 57.3 50.3
Micro-F1 66.3 67.0 61.4 73.0
BibTeX entry and citation info

TBA

Runs of cardiffnlp tweet-topic-large-multilingual on huggingface.co

31
Total runs
0
24-hour runs
0
3-day runs
19
7-day runs
19
30-day runs

More Information About tweet-topic-large-multilingual huggingface.co Model

More tweet-topic-large-multilingual license Visit here:

https://choosealicense.com/licenses/mit

tweet-topic-large-multilingual huggingface.co

tweet-topic-large-multilingual huggingface.co is an AI model on huggingface.co that provides tweet-topic-large-multilingual's model effect (), which can be used instantly with this cardiffnlp tweet-topic-large-multilingual model. huggingface.co supports a free trial of the tweet-topic-large-multilingual model, and also provides paid use of the tweet-topic-large-multilingual. Support call tweet-topic-large-multilingual model through api, including Node.js, Python, http.

tweet-topic-large-multilingual huggingface.co Url

https://huggingface.co/cardiffnlp/tweet-topic-large-multilingual

cardiffnlp tweet-topic-large-multilingual online free

tweet-topic-large-multilingual huggingface.co is an online trial and call api platform, which integrates tweet-topic-large-multilingual's modeling effects, including api services, and provides a free online trial of tweet-topic-large-multilingual, you can try tweet-topic-large-multilingual online for free by clicking the link below.

cardiffnlp tweet-topic-large-multilingual online free url in huggingface.co:

https://huggingface.co/cardiffnlp/tweet-topic-large-multilingual

tweet-topic-large-multilingual install

tweet-topic-large-multilingual is an open source model from GitHub that offers a free installation service, and any user can find tweet-topic-large-multilingual on GitHub to install. At the same time, huggingface.co provides the effect of tweet-topic-large-multilingual install, users can directly use tweet-topic-large-multilingual installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

tweet-topic-large-multilingual install url in huggingface.co:

https://huggingface.co/cardiffnlp/tweet-topic-large-multilingual

Url of tweet-topic-large-multilingual

tweet-topic-large-multilingual huggingface.co Url

Provider of tweet-topic-large-multilingual huggingface.co

cardiffnlp
ORGANIZATIONS

Other API from cardiffnlp