Downloads · 30 days
0
fabiopassos/miso-br-classifier
miso-br-classifier is a machine learning model from fabiopassos. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model classifies text in Brazilian Portuguese as misogynistic or non-misogynistic. It's trained on the MISO-BR dataset.
Downloads · 30 days
0
Access
Public
Updated Sep 28, 2025
Repo size
1.2 MB
Likes
0
Public
Click a slice to open those files.
.joblib1.2 MB · 99%
From the Hugging Face model README
This model classifies text in Brazilian Portuguese as misogynistic or non-misogynistic. It's trained on the MISO-BR dataset.
The model was evaluated on a test set and achieved:
This project requires the following libraries:
scikit-learn==1.7.0spacy==3.7.2joblib>=1.3.0pt_core_news_sm (downloadable from here)Install the dependencies using the requirements.txt file:
pip install -r requirements.txt
from huggingface_hub import hf_hub_download
import joblib
import spacy
# Download the model from Hugging Face Hub
model_path = hf_hub_download(repo_id="fabiopassos/miso-br-classifier",
filename="models/miso_br_rf_classifier.joblib")
# Load the model
model = joblib.load(model_path)
# Load spaCy for Portuguese
nlp = spacy.load("pt_core_news_sm")
# Preprocess function
def preprocess_text(text):
doc = nlp(text)
tokens = [token.lemma_.lower() for token in doc
if not token.is_stop and not token.is_punct and token.is_alpha]
return " ".join(tokens)
# Example text
text = "Seu texto para classificar aqui"
processed_text = preprocess_text(text)
# Predict
prediction = model.predict([processed_text])[0]
probability = model.predict_proba([processed_text])[0][1]
print(f"Texto: {text}")
print(f"É misógino: {'Sim' if prediction == 1 else 'Não'}")
print(f"Probabilidade: {probability:.4f}")