Text Classification
Transformers
PyTorch
English
distilbert
fill-mask
legal
PyTorch
sentiment-analysis
text-embeddings-inference
Instructions to use ajinathgh/sentiment_analysis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ajinathgh/sentiment_analysis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="ajinathgh/sentiment_analysis", device_map="auto")# Load model directly from transformers import AutoTokenizer, AutoModelForMaskedLM tokenizer = AutoTokenizer.from_pretrained("ajinathgh/sentiment_analysis") model = AutoModelForMaskedLM.from_pretrained("ajinathgh/sentiment_analysis", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| license: mit | |
| library_name: transformers | |
| datasets: | |
| - stanfordnlp/sst2 | |
| language: | |
| - en | |
| base_model: | |
| - distilbert/distilbert-base-uncased | |
| pipeline_tag: text-classification | |
| tags: | |
| - legal | |
| - PyTorch | |
| - text-classification | |
| - sentiment-analysis | |
| # Simple Text Classifier | |
| This is a fine-tuned model for text classification based on `distilbert-base-uncased`. | |
| ## Model Details | |
| - Model Type: Text Classification | |
| - Number of Classes: 2 | |
| - Hidden Size: 768 | |
| ## Usage | |
| ```python | |
| from transformers import AutoTokenizer | |
| from huggingface_text_classifier.model import SimpleTextClassifier | |
| # Load model and tokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("ajinathgh/sentiment_analysis") | |
| model = SimpleTextClassifier.from_pretrained("ajinathgh/sentiment_analysis") | |
| # Prepare input | |
| inputs = tokenizer("Example text to classify", return_tensors="pt") | |
| # Get predictions | |
| outputs = model(**inputs) | |
| predicted_class = outputs.argmax(-1).item() | |
| ``` | |