While going through the docs in tensorflow transform I came across function to perform TD-IDF.
tft.tfidf(
x, vocab_size, smooth=True, name=None
)
As the docs in not clear in providing example of how to perform TD-IDF I tried using example_string
example_strings=[["I", "like", "pie", "pie", "pie"], ["yum", "yum", "pie"]]
and a vocab size of 1000.(Just random number) but the below code giving me an attribute error.
tft.tfidf(example_strings, vocab_size=1000)
AttributeError: 'list' object has no attribute 'indices'
Please help me to figure this out as I am naive to Tensorflow transform ops.