intent_classification package
constants
- class intent_classification.constants.IntentConstants[source]
Bases:
object- USER_INTENT_CHANGE_CROP = 'Change_crop'
- USER_INTENT_DISAPPOINTMENT = 'Disappointment'
- USER_INTENT_EXIT = 'Exit'
- USER_INTENT_FARMING = 'Farming_related'
- USER_INTENT_GREETING = 'Greeting'
- USER_INTENT_OUT_CONTEXT = 'Out_of_context'
- USER_INTENT_REFERRING_BACK = 'Referring_back'
- USER_INTENT_UNCLEAR = 'Unclear'
intent
This is “intent.py”.
from django_core.config import Config from rag_service.openai_service import make_openai_request from intent_classification.constants import IntentConstants
- async intent_classification.intent.classify_intent(qn)[source]
Classify the query or question intent into any of the classification to which it falls under.
- async intent_classification.intent.generate_convo_response(qn, name)[source]
Classify the query or question intent as a general conversation.
- async intent_classification.intent.generate_exit_response(qn, name)[source]
Classify the query or question intent as an exit conversation.
- async intent_classification.intent.generate_out_of_context_response(qn, name)[source]
Classify the query or question intent as an out of context question.