प्रश्न समानता और व्याकरणिक शुद्धता

Python में Natural Language Processing (NLP)

Fouad Trad

Machine Learning Engineer

प्रश्न समानता

  • पहचानता है कि दो प्रश्न पराफ्रेज़ हैं या नहीं
  • उपयोगी है:
    • डीडुप्लिकेशन
    • मिलते-जुलते प्रश्नों का क्लस्टरिंग
    • सर्च सटीकता में सुधार
  • Quora Question Pairs (QQP) डेटासेट पर प्रशिक्षित मॉडलों से किया जाता है

तीन लोग प्रश्न पूछते हुए दिख रहे हैं.

Python में Natural Language Processing (NLP)

QQP पाइपलाइन

from transformers import pipeline

qqp_pipeline = pipeline( task="text-classification", model="textattack/bert-base-uncased-QQP" )
question1 = "How can I learn Python?" question2 = "What is the best way to study Python?"
result = qqp_pipeline({"text": question1, "text_pair": question2})
print(result)
{'label': 'LABEL_1', 'score': 0.6853412985801697}
Python में Natural Language Processing (NLP)

QQP पाइपलाइन

from transformers import pipeline
qqp_pipeline = pipeline(
    task="text-classification", 
    model="textattack/bert-base-uncased-QQP"
    )
question1 = "How can I learn Python?"
question2 = "What is the capital of France?"
result = qqp_pipeline({"text": question1, "text_pair": question2})
print(result)
{'label': 'LABEL_0', 'score': 0.9999338388442993}
Python में Natural Language Processing (NLP)

व्याकरणिक शुद्धता का आकलन

  • किसी टेक्स्ट की व्याकरणिक शुद्धता का आकलन करता है
  • उपयोगी है:

    • शैक्षिक टूल्स
    • ग्रामर चेकर
    • राइटिंग असिस्टेंट्स
  • Corpus of Linguistic Acceptability (CoLA) डेटासेट पर प्रशिक्षित मॉडलों से किया जाता है

एक व्यक्ति लिखे हुए टेक्स्ट की शुद्धता आँकते हुए.

Python में Natural Language Processing (NLP)

CoLA पाइपलाइन

from transformers import pipeline
cola_classifier = pipeline(
  task="text-classification", 
  model="textattack/distilbert-base-uncased-CoLA"
)

result = cola_classifier("The cat sat on the mat.")
print(result)
[{'label': 'LABEL_1', 'score': 0.9918296933174133}]
Python में Natural Language Processing (NLP)

CoLA पाइपलाइन

from transformers import pipeline
cola_classifier = pipeline(
  task="text-classification", 
  model="textattack/distilbert-base-uncased-CoLA"
)
result = cola_classifier("The cat on sat mat the.")
print(result)
[{'label': 'LABEL_0', 'score': 0.9628171324729919}]
Python में Natural Language Processing (NLP)

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

Python में Natural Language Processing (NLP)

Preparing Video For Download...