stanfordnlp/imdb
Viewer • Updated • 100k • 177k • 370
How to use LH-Tech-AI/CritiqueCore_v1 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="LH-Tech-AI/CritiqueCore_v1") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("LH-Tech-AI/CritiqueCore_v1", dtype="auto")# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("LH-Tech-AI/CritiqueCore_v1", dtype="auto")CritiqueCore v1 is a compact Transformer model trained from scratch for sentiment analysis. Unlike models that use transfer learning, this model was initialized with random weights and learned the nuances of language (including sarcasm and basic cross-lingual sentiment) exclusively from the IMDb movie reviews dataset.
First, you have to download CritiqueCore_v1_Model.zip and unpack it. Then, you can use inference.py from this repos' files list. Have fun :D
Input:
This movie was an absolute masterpiece! The acting was incredible and I loved every second.
Output: POSITIVE (99.03% confidence)
Input:
Oh great, another superhero movie. Just what the world needed. I loved sitting through 3 hours of CGI vomit.
Output: NEGATIVE (93.81% confidence)
Input:
Why did they even produce it?
Output: NEGATIVE (99.37% confidence)
The full training code can be found in this repo as train.ipynb.
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="LH-Tech-AI/CritiqueCore_v1")