Version: 3.x
rasa.nlu.extractors.crf_entity_extractor
CRFEntityExtractorOptions Objects
class CRFEntityExtractorOptions(str, Enum)
Features that can be used for the 'CRFEntityExtractor'.
CRFEntityExtractor Objects
@DefaultV1Recipe.register(
DefaultV1Recipe.ComponentType.ENTITY_EXTRACTOR, is_trainable=True
)
class CRFEntityExtractor(GraphComponent, EntityExtractorMixin)
Implements conditional random fields (CRF) to do named entity recognition.
required_components
@classmethod
def required_components(cls) -> List[Type]
Components that should be included in the pipeline before this component.
get_default_config
@staticmethod
def get_default_config() -> Dict[Text, Any]
The component's default config (see parent class for full docstring).
__init__
def __init__(config: Dict[Text, Any],
model_storage: ModelStorage,
resource: Resource,
entity_taggers: Optional[Dict[Text, "CRF"]] = None) -> None
Creates an instance of entity extractor.
create
@classmethod
def create(cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource,
execution_context: ExecutionContext) -> CRFEntityExtractor
Creates a new untrained component (see parent class for full docstring).
required_packages
@staticmethod
def required_packages() -> List[Text]
Any extra python dependencies required for this component to run.
train
def train(training_data: TrainingData) -> Resource
Trains the extractor on a data set.
process
def process(messages: List[Message]) -> List[Message]
Augments messages with entities.
extract_entities
def extract_entities(message: Message) -> List[Dict[Text, Any]]
Extract entities from the given message using the trained model(s).
load
@classmethod
def load(cls, config: Dict[Text, Any], model_storage: ModelStorage,
resource: Resource, execution_context: ExecutionContext,
**kwargs: Any) -> CRFEntityExtractor
Loads trained component (see parent class for full docstring).
persist
def persist() -> None
Persist this model into the passed directory.