Run a Hugging Face Natural Language Processing model on Arm

Give feedback

How would you rate this Learning Path?

Review frequently asked questions

AI-assisted

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.

Close
?
How can I analyze my own text with the example?
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.
How does the example handle usernames and links?
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.
Which Hugging Face model should I use?
Use the cardiffnlp/twitter-roberta-base-sentiment-latest model.
What result should I expect when I run the 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.
How do I know that the PyTorch profiler captured my run?
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.

Share

Tell others about this Learning Path.

Back
Return to Servers and Cloud Computing