src.pipeline.nlu
Submodules
Classes
Simple Natural Language Understanding component. |
|
Enhanced Natural Language Understanding component |
Package Contents
- class SimpleNLU[source]
Simple Natural Language Understanding component. Uses keyword matching for intent recognition.
- patterns
- class SpacyNLU(model='en_core_web_sm')[source]
Enhanced Natural Language Understanding component with advanced intent recognition and entity extraction.
- intent_patterns
- _fuzzy_match(text: str, patterns: List[str], threshold: float = 0.6) bool[source]
Perform fuzzy matching of text against patterns.
- Parameters:
text – Input text to match
patterns – List of pattern strings
threshold – Similarity threshold
- Returns:
Boolean indicating if a match is found
- get_intent(text: str) Dict[str, Any][source]
Extract intent with more context and details.
- Parameters:
text – User input text
- Returns:
Dictionary with intent details