fact or opinion xlmr el
lighteternalIntroduction
The FACT-OR-OPINION-XLMR-EL is a binary text classification model developed to distinguish between factual and opinionated sentences. It is based on the XLM-Roberta architecture and supports multilingual capabilities, specifically trained on English and Greek datasets.
Architecture
The model utilizes the XLM-Roberta-base architecture with a binary classification head. This allows the model to classify sentences as either facts or opinions. It leverages zero-shot learning capabilities, supporting various languages within the XLM-R family, although it was specifically trained on English and Greek sentences.
Training
Training was conducted using a dataset containing approximately 9,000 annotated sentences, classified as subjective or objective. This dataset was translated into Greek using Google Translate and combined with the original English to form a mixed EN-EL dataset. The model underwent training for five epochs with a batch size of 8. The test set evaluation showed an accuracy of 0.952, precision of 0.945, recall of 0.960, and an F1 score of 0.952.
Guide: Running Locally
- Environment Setup: Ensure you have Python and PyTorch installed. Install the Hugging Face Transformers library using
pip install transformers
. - Model Download: Use the Transformers library to load the model:
from transformers import pipeline classifier = pipeline("text-classification", model="lighteternal/fact-or-opinion-xlmr-el")
- Inference: Classify sentences by passing them to the model:
result = classifier("Your sentence here") print(result)
For optimal performance, especially on large datasets, consider using cloud GPU services such as AWS, Google Cloud, or Azure.
License
This model is released under the Apache 2.0 License, allowing for both personal and commercial use, with proper attribution.