Malicious Text Detection Model for EmoRAG

Model Description

This model is designed to detect malicious texts, particularly those containing emoticons, using a BERT-based architecture.

Intended Use

  • Primary Use: Detection of malicious texts containing emoticons.
  • Applications:
    • Content moderation for online platforms.
    • Adversarial text filtering in natural language processing pipelines.
    • Research on malicious text detection and adversarial attacks.

Each data point contains up to eight emoticons, and the dataset was carefully curated to ensure diversity and balance.

How to Use the Model

You can load and use the trained BERT-based model for malicious text detection with the following code:

from transformers import BertTokenizer, BertForSequenceClassification
import torch

# Load the trained model and tokenizer
model = BertForSequenceClassification.from_pretrained('path_to_your_model')
tokenizer = BertTokenizer.from_pretrained('path_to_your_model')

# Example text (malicious with emoticons)
text = "However, there (●′ω`●) is any huge evidence ⊙︿⊙ that one single drug shot may induce a permanent ƪ(•̃͡ε•̃͡)∫ʃ psychotic disorder. +ˍ+ The other hand is in regards of the the use of dopaminergic agonists in Parkinson desease, what did (ΘoΘ) not ╰(*´︶`*)╯ show in that patients a ゚ヽ(●´ω`●)ノ。 psychotic disorder but induce a hard psychotic effect in a normal subject mainly mixed 桃カラ≪( \(・ω・)/ )≫オハヨゥ☆ with alcholl.", 

# Tokenize the input text
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)

# Make a prediction
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits
    prediction = torch.argmax(logits, dim=-1)

# Print the prediction
print(f"Prediction: {'Malicious' if prediction.item() == 1 else 'Clean'}")
Downloads last month
4
Safetensors
Model size
109M params
Tensor type
F32
·
Inference Examples
Unable to determine this model's library. Check the docs .

Model tree for EmoRAG/EmoRAG_detect

Finetuned
(2421)
this model

Dataset used to train EmoRAG/EmoRAG_detect