diff --git a/ljh.py b/ljh.py deleted file mode 100644 index 51b4db5..0000000 --- a/ljh.py +++ /dev/null @@ -1,21 +0,0 @@ -from sklearn.feature_extraction.text import CountVectorizer - - -docs = [ - "Python 是 编程 语言", - "Java 是 编程 语言", - "Python Python Python" -] - - -vectorizer = CountVectorizer() -X = vectorizer.fit_transform(docs) - - -print("词表(Vocabulary):") -print(vectorizer.get_feature_names_out()) - - -print("\n每个文档的BoW向量:") -for i, doc_vec in enumerate(X.toarray()): - print(f"Doc{i+1}: {doc_vec}") \ No newline at end of file