Prepare token-labelled data
Collect annotated utterances with token-level slot labels (BIO or similar) and split by speaker/session to avoid leakage.
Extract slots from utterances. Evaluate per-slot accuracy.
Slot filling assigns labels to tokens in a user utterance (for example, departure_city: 'Mumbai') so a dialogue system can extract structured information. Real data include varied phrasing, missing values, nested entities and noisy speech transcripts; evaluation is typically per-slot precision, recall and F1 as well as end-to-end form accuracy.
Learning concept · Not a validated service
Slot filling assigns labels to tokens in a user utterance (for example, departure_city: 'Mumbai') so a dialogue system can extract structured information. Real data include varied phrasing, missing values, nested entities and noisy speech transcripts; evaluation is typically per-slot precision, recall and F1 as well as end-to-end form accuracy.
A proposed application: extract shipping addresses, dates or service types from user messages so a dialogue manager can fill form fields. Any production use should keep a human reviewer in the loop for low-confidence extractions.
Collect annotated utterances with token-level slot labels (BIO or similar) and split by speaker/session to avoid leakage.
Start with a CRF or BiLSTM-CRF baseline or a transformer token-classifier and represent tokens with contextual embeddings.
Report precision, recall and F1 per slot type and micro/macro aggregated scores; inspect common confusion pairs and low-frequency slots.
Wrap the extractor behind an API that returns confidences and exposes a human-review fallback for low-confidence or unseen slot values.
The supplied starter implements a binary text classifier: it vectorises six whole-sentence examples with TF-IDF, fits a LogisticRegression pipeline, prints a classification report and makes one sample prediction. It does not perform token-level labelling or sequence tagging required for slot filling.
model = Pipeline(
steps=[
("tfidf", TfidfVectorizer(ngram_range=(1, 2), min_df=1)),
("classifier", LogisticRegression(max_iter=1000)),
]
)
model.fit(X_train, y_train)
predictions = model.predict(X_test)The code lacks any token-level (BIO) slot annotations, a sequence-tagging model (CRF, BiLSTM-CRF, or transformer token classifier) and does not produce per-slot predictions; it only does sentence-level binary classification on six synthetic examples.
A proposed extension: collect annotated support-chat utterances, train a transformer token-classifier to extract entities like product, issue_type and urgency, and deploy behind an API that returns slot values and confidence for human review.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.