koelectra base v3 generalized sentiment analysis
CopycatsIntroduction
The koelectra-base-v3-generalized-sentiment-analysis
model is designed for text classification, specifically sentiment analysis, in the Korean language. It is built using the Transformers library and is compatible with the PyTorch framework. The model is available under the Apache 2.0 license, allowing for flexible use in various applications.
Architecture
This model utilizes the ELECTRA architecture, which is a transformer-based model known for its efficiency in tasks such as sentiment analysis. It leverages a discriminative approach, making use of a generator-discriminator setup to improve the quality of the language model.
Training
The model has been trained using diverse datasets to recognize and classify sentiment in Korean text. It distinguishes between positive and negative sentiments, providing a label and a confidence score for each prediction. This training involves fine-tuning on sentiment-labeled datasets, optimizing the model's ability to assess sentiment in a wide range of text inputs.
Guide: Running Locally
To run the koelectra-base-v3-generalized-sentiment-analysis
model locally, follow these steps:
-
Install Required Libraries: Ensure you have PyTorch and Transformers installed in your Python environment.
pip install torch transformers
-
Import Libraries and Load Model:
import torch from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline tokenizer = AutoTokenizer.from_pretrained("Copycats/koelectra-base-v3-generalized-sentiment-analysis") model = AutoModelForSequenceClassification.from_pretrained("Copycats/koelectra-base-v3-generalized-sentiment-analysis") sentiment_classifier = TextClassificationPipeline(tokenizer=tokenizer, model=model)
-
Prepare and Classify Text Data:
review_list = [ '이쁘고 좋아요~~~씻기도 편하고 아이고 이쁘다고 자기방에 갖다놓고 잘써요~^^', # Add more reviews as needed ] for review in review_list: pred = sentiment_classifier(review) print(f'{review}\n>> {pred[0]}')
-
Cloud GPU Recommendation: For large-scale processing or faster inference, consider using cloud GPU services like AWS EC2 with NVIDIA GPUs or Google Cloud Platform's AI Platform.
License
The koelectra-base-v3-generalized-sentiment-analysis
model is released under the Apache 2.0 license. This allows users to freely use, modify, and distribute the model, provided that any modifications are also shared under the same license.