bert base japanese v2 wrime fine tune
patrickramosIntroduction
The WRIME-Fine-Tuned BERT Base Japanese model is a specialized version of the BERT model, fine-tuned for emotion analysis in Japanese text. It is based on the cl-tohoku/bert-base-japanese-v2
model and trained on the WRIME dataset, which includes Japanese tweets annotated with emotion intensities for both writers and readers.
Architecture
The model architecture is based on cl-tohoku/bert-base-japanese-v2
. For detailed information about the architecture, tokenization, and pretraining, refer to the original model card at Hugging Face.
Training
This model was fine-tuned on the WRIME dataset, which contains Japanese tweets with emotion annotations. It predicts intensity scores for eight emotions: joy, sadness, anticipation, surprise, anger, fear, disgust, and trust. The fine-tuning involved regressing the emotion intensities for both writers and readers (eight emotions each). The process used the AdamW optimizer with specific hyperparameters and was completed in 3 hours using an NVIDIA Tesla K80 GPU.
Guide: Running Locally
To run this model locally, follow these steps:
-
Install Dependencies: Make sure you have Python installed and set up a virtual environment. Install the necessary libraries:
pip install torch transformers
-
Download the Model: You can download the model from Hugging Face's model hub:
from transformers import BertForSequenceClassification, BertTokenizer model_name = "patrickramos/bert-base-japanese-v2-wrime-fine-tune" model = BertForSequenceClassification.from_pretrained(model_name) tokenizer = BertTokenizer.from_pretrained(model_name)
-
Inference: Use the model to predict emotion intensities for a given Japanese text:
inputs = tokenizer("車のタイヤがパンクしてた。。いたずらの可能性が高いんだって。。", return_tensors="pt") outputs = model(**inputs)
-
Cloud GPUs: For faster inference and training, consider using cloud GPU services like AWS EC2, Google Cloud Platform, or Azure.
License
The model is licensed under the Creative Commons Attribution-ShareAlike 3.0 License (cc-by-sa-3.0). You are free to share and adapt the model, provided you give appropriate credit and distribute your contributions under the same license.