टेक्स्ट क्लासिफिकेशन

Hugging Face के साथ काम करना

Jacob H. Marquez

Lead Data Engineer

टेक्स्ट क्लासिफिकेशन: सेंटिमेंट एनालिसिस

$$

  • टेक्स्ट को उसकी भावनात्मक टोन के आधार पर लेबल करता है

$$

Sentiment analysis

$$

  • उपयोग: रिव्यू विश्लेषण, सोशल मीडिया सेंटिमेंट ट्रैकिंग

Sentiment icon

Hugging Face के साथ काम करना

सेंटिमेंट एनालिसिस: कोडिंग उदाहरण

from transformers import pipeline

my_pipeline = pipeline( "text-classification", model="distilbert-base-uncased-finetuned-sst-2-english" )
print(my_pipeline("Wi-Fi is slower than a snail today!"))
[{'label': 'NEGATIVE', 'score': 0.99}]
Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन: व्याकरणिक शुद्धता

$$

Grammar check

$$

  • व्याकरणिक शुद्धता के लिए टेक्स्ट का मूल्यांकन करता है

$$

Example of grammatical correctness

$$

  • उपयोग: ग्रामर चेकर, भाषा सीखने के टूल्स
Hugging Face के साथ काम करना

व्याकरणिक शुद्धता: कोडिंग उदाहरण

from transformers import pipeline


# Create a pipeline for grammar checking grammar_checker = pipeline( task="text-classification", model="abdulmatinomotoso/English_Grammar_Checker" )
# Check grammar of the input text print(grammar_checker("He eat pizza every day."))
[{'label': 'LABEL_0', 'score': 0.99}]
Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन: QNLI

$$ Q&A

$$

$$

  • जाँचता है कि कोई प्रीमाइस प्रश्न का उत्तर देता है या नहीं

  • उपयोग: Q&A सिस्टम, फैक्ट-चेकिंग

Example of QNLI

Hugging Face के साथ काम करना

QNLI: कोडिंग उदाहरण

from transformers import pipeline


classifier = pipeline( task="text-classification", model="cross-encoder/qnli-electra-base" )
classifier("Where is Seattle located?, Seattle is located in Washington state.")
[{'label': 'LABEL_0', 'score': 0.997}]
Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन: डायनेमिक कैटेगरी असाइनमेंट

$$

  • कंटेंट के आधार पर श्रेणियाँ डायनेमिक रूप से असाइन करता है

Category assignment example

  • उपयोग: कंटेंट मॉडरेशन, रिकमेंडेशन सिस्टम

$$

Category Assignment

Hugging Face के साथ काम करना

डायनेमिक कैटेगरी असाइनमेंट: कोडिंग उदाहरण

classifier = pipeline(
  task="zero-shot-classification", 
  model="facebook/bart-large-mnli")


text = "Hey, DataCamp; we would like to feature your courses in our newsletter!" categories = ["marketing", "sales", "support"]
output = classifier(text, categories)
print(f"Top Label: {output['labels'][0]} with score: {output['scores'][0]}")
Top Label: support with score: 0.8183
Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन की चुनौतियाँ

Ambiguity

Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन की चुनौतियाँ

Sarcasm

Hugging Face के साथ काम करना

टेक्स्ट क्लासिफिकेशन की चुनौतियाँ

Multilingual

Hugging Face के साथ काम करना

अभ्यास करते हैं!

Hugging Face के साथ काम करना

Preparing Video For Download...