From 1fc91a72db9fa919d4c56f3f4e673ba5c151f784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BD=B3=E8=B1=AA?= <2509165033@student.example.com> Date: Thu, 23 Apr 2026 15:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20ljh.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ljh.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 ljh.py 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