diff --git a/docs/api_docs/python/tft/tfidf.md b/docs/api_docs/python/tft/tfidf.md index 7397b446..19c6f834 100644 --- a/docs/api_docs/python/tft/tfidf.md +++ b/docs/api_docs/python/tft/tfidf.md @@ -21,12 +21,14 @@ The term frequency of a term in a document is calculated as The inverse document frequency of a term is, by default, calculated as 1 + log((corpus size + 1) / (count of documents containing term + 1)). - +``` Example usage: example strings [["I", "like", "pie", "pie", "pie"], ["yum", "yum", "pie]] + in: SparseTensor(indices=[[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 0], [1, 1], [1, 2]], values=[1, 2, 0, 0, 0, 3, 3, 0]) + out: SparseTensor(indices=[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1]], values=[1, 2, 0, 3, 0]) SparseTensor(indices=[[0, 0], [0, 1], [0, 2], [1, 0], [1, 1]], @@ -34,7 +36,7 @@ Example usage: (2/3)*(log(3/2)+1), (1/3)] NOTE that the first doc's duplicate "pie" strings have been combined to one output, as have the second doc's duplicate "yum" strings. - +``` #### Args: * `x`: A `SparseTensor` representing int64 values (most likely that are the @@ -54,4 +56,4 @@ Example usage: Two `SparseTensor`s with indices [index_in_batch, index_in_bag_of_words]. The first has values vocab_index, which is taken from input `x`. -The second has values tfidf_weight. \ No newline at end of file +The second has values tfidf_weight.