タグ付けされた質問 「tf-idf」

6
Python:tf-idf-cosine:ドキュメントの類似性を見つける
私はパート1とパート2で利用可能なチュートリアルに従っていました。残念ながら、著者には、コサイン類似度を使用して2つのドキュメント間の距離を実際に見つけることを含む最後のセクションの時間はありませんでした。私は記事内の例に従って、stackoverflowからの次のリンクの助けを借りて、上記のリンクで言及されているコードが含まれています(人生を楽にするために) from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from nltk.corpus import stopwords import numpy as np import numpy.linalg as LA train_set = ["The sky is blue.", "The sun is bright."] # Documents test_set = ["The sun in the sky is bright."] # Query stopWords = stopwords.words('english') vectorizer = CountVectorizer(stop_words …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.