Editing
Nlp
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Text classification with a pre-trained transformer (HuggingFace):''' <syntaxhighlight lang="python"> from transformers import pipeline # Sentiment analysis using a pre-trained model classifier = pipeline("sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english") results = classifier([ "This film was absolutely wonderful!", "The service was terrible and I want a refund." ]) # [{'label': 'POSITIVE', 'score': 0.9998}, {'label': 'NEGATIVE', 'score': 0.9996}] # Named Entity Recognition ner = pipeline("ner", grouped_entities=True) ner("Apple was founded by Steve Jobs in Cupertino, California.") # [{'entity_group': 'ORG', 'word': 'Apple', ...}, # {'entity_group': 'PER', 'word': 'Steve Jobs', ...}, # {'entity_group': 'LOC', 'word': 'Cupertino, California', ...}] </syntaxhighlight> ; Common NLP task β model mapping : '''Text classification''' β BERT fine-tuned, DistilBERT, RoBERTa : '''Text generation''' β GPT-2/3/4, LLaMA, Mistral : '''Translation''' β MarianMT, NLLB, Google Translate API : '''Summarization''' β BART, Pegasus, T5 : '''Question answering''' β RoBERTa fine-tuned on SQuAD : '''Semantic search''' β Sentence-BERT, E5, text-embedding-ada-002 </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information