Run a Hugging Face Natural Language Processing model on Arm
Introduction
Run a Hugging Face NLP model on Arm servers
Next Steps
Run a Hugging Face Natural Language Processing model on Arm
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Replace the string assigned to
text in sentiment-analysis.py, save the file, and run python sentiment-analysis.py again. The script preprocesses your text before passing it to the tokenizer and model.When you run the script, its
preprocess function replaces words that start with @ and contain more than one character with @user. It replaces words that start with http with http before tokenization.Use the
cardiffnlp/twitter-roberta-base-sentiment-latest model.A successful run prints three ranked sentiment labels with confidence scores. The scores should sum to 1. The first line is the model’s strongest prediction.
You should see a table of CPU operators and their execution times before the classification output. The
model_inference row summarizes the profiled inference region.