Spaces:
Sleeping
Sleeping
Download src/features.py from Vivekkrishu/chatbot: direct link, hf CLI and curl.
- Browser
- Download file 402 Bytes
-
https://huggingface.co/spaces/Vivekkrishu/chatbot/resolve/main/src/features.py
- Command line
-
hf download hf://spaces/Vivekkrishu/chatbot/src/features.py
-
curl -L -o features.py https://huggingface.co/spaces/Vivekkrishu/chatbot/resolve/main/src/features.py
402 Bytes
| from sklearn.feature_extraction.text import TfidfVectorizer | |
| from sklearn.pipeline import Pipeline | |
| from sklearn.linear_model import LogisticRegression | |
| def build_pipeline(random_state=42): | |
| vect = TfidfVectorizer(max_df=0.9, min_df=1, ngram_range=(1,2)) | |
| clf = LogisticRegression(max_iter=1000, random_state=random_state) | |
| return Pipeline([ | |
| ("tfidf", vect), | |
| ("clf", clf) | |
| ]) | |