diff --git a/semantic_router/encoders/tfidf.py b/semantic_router/encoders/tfidf.py index 68baceaa900bce7855889b47852e345c65e487e1..2782b1ed63290cd2059cfe11f9652ddc334a7bf7 100644 --- a/semantic_router/encoders/tfidf.py +++ b/semantic_router/encoders/tfidf.py @@ -4,11 +4,13 @@ from semantic_router.encoders import BaseEncoder from semantic_router.route import Route from numpy.linalg import norm import string +from typing import Dict +from numpy import ndarray class TfidfEncoder(BaseEncoder): - idf: np.ndarray - word_index: dict + idf: ndarray = np.array([]) + word_index: Dict = {} def __init__(self, name: str = "tfidf"): super().__init__(name=name)