Skip to content

Commit b0ae1af

Browse files
committed
20251121
1 parent 672b2fc commit b0ae1af

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.DS_Store

0 Bytes
Binary file not shown.

docs/install.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
```
7-
pip3 install cntext --upgrade
7+
pip3 install cntext
88
```
99

1010

@@ -13,4 +13,14 @@ pip3 install cntext --upgrade
1313
## 环境问题
1414
需要注意, **cntext2.x使用环境为Python3.9 ~ 3.12**,如安装失败,问题可能出在python版本问题;
1515

16+
<br>
17+
18+
如cntext安装成功,但是导入失败,可先将scipy、numpy、gensim降到指定版本,看能否解决问题。
19+
20+
```
21+
pip install scipy==1.12.0
22+
pip install numpy==1.26.4
23+
pip install gensim==4.3.3
24+
```
25+
1626

docs/intro.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ cntext 是专为**社会科学实证研究者**设计的中文文本分析 Pytho
1818
- 两行代码训练领域专用词向量(Word2Vec/GloVe):``ct.Word2Vec()``
1919
- 构建概念语义轴(如“创新 vs 守旧”):``ct.generate_concept_axis()``
2020
- 通过语义投影量化刻板印象、组织文化偏移:``ct.project_text()``
21+
- 计算文本对应的词嵌入投影得分WEPA:``ct.wepa()``
2122
4. **融合大模型进行结构化分析**
2223
- 调用 LLM 对文本进行语义解析,返回结构化结果(如情绪维度、意图分类):``ct.llm()``
2324

@@ -61,7 +62,6 @@ cntext2.x 含io、model、stats、mind五个模块
6162
| ***model*** | ***ct.glove2word2vec(glove_file, word2vec_file)*** | 将GLoVe模型.txt文件转化为Word2Vec模型.txt文件; 一般很少用到 |
6263
| ***model*** | ***ct.evaluate_similarity(wv, file=None)*** | 使用近义法评估模型表现,默认使用内置的数据进行评估。|
6364
| ***model*** | ***ct.evaluate_analogy(wv, file=None)*** | 使用类比法评估模型表现,默认使用内置的数据进行评估。|
64-
| ***model*** | ***project_word(wv, a, b, weight=None)*** | 在向量空间中, 计算词语a在词语b上的投影。|
6565
| ***model*** | ***ct.load_w2v(wv_path)*** | 读取cntext2.x训练出的Word2Vec/GloVe模型文件 |
6666
| ***model*** | ***ct.expand_dictionary(wv, seeddict, topn=100)*** | 扩展词典, 结果保存到路径[output/Word2Vec]|
6767
| ***model*** | ***ct.SoPmi(corpus_file, seed_file, lang='chinese')*** | 共现法扩展词典 |
@@ -85,6 +85,7 @@ cntext2.x 含io、model、stats、mind五个模块
8585
| ***mind*** | ***ct.sematic_projection(wv, words, c_words1, c_words2)*** | 测量语义投影 |
8686
| ***mind*** | ***ct.project_word(wv, a, b)*** | 测量词语a在词语b上的投影语 |
8787
| **mind** | ***ct.project_text(wv, text, axis, lang='chinese', cosine=False)*** | 计算词语文本text在概念轴向量axis上的投影值|
88+
| ***mind*** | ***ct.wepa(wv, text, poswords, negwords, lang='chinese')*** | 计算文本在概念轴上的投影得分,返回wepa得分|
8889
| ***mind*** | ***ct.sematic_distance(wv, words, c_words1, c_words2)*** | 测量语义距离 |
8990
| ***mind*** | ***ct.divergent_association_task(wv, words)*** | 测量发散思维(创造力) |
9091
| ***mind*** | ***ct.discursive_diversity_score(wv, words)*** | 测量语言差异性(认知差异性) |

docs/mind.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
| **_mind_** | `ct.sematic_projection(wv, words, poswords, negwords)` | 测量语义投影 |
1515
| **_mind_** | `ct.project_word(wv, a, b, cosine=False)` | 在向量空间中, 计算词语 a 在词语 b 上的投影。 |
1616
| **mind** | `ct.project_text(wv, text, axis, lang='chinese', cosine=False)` | 计算词语文本text在概念轴向量axis上的投影值|
17+
值|
18+
| **mind** | `ct.wepa(wv, text, poswords, negwords, lang='chinese')` | 计算文本在概念轴上的投影得分,返回wepa得分|
1719
| **_mind_** | `ct.sematic_distance(wv, words, c_words1, c_words2)` | 测量语义距离 |
1820
| **_mind_** | `ct.divergent_association_task(wv, words)` | 测量发散思维(创造力) |
1921
| **_mind_** | `ct.discursive_diversity_score(wv, words)` | 测量语言差异性(认知差异性) |

0 commit comments

Comments
 (0)