Comments (2)
另外,请问这部分
total * v / (ngrams[j].get(w[:j+1], total) * ngrams[i-j-1].get(w[j+1:], total))
我理解分母的两个乘数,应该是大于等于v的,所以default值理论上应该设为v,为什么这里设为了total呢?
from word-discovery.
还有一个问题,加载ngram这里:
for j in range(len(c)): self.ngrams[j][c[:j+1]] = self.ngrams[j].get(c[:j+1], 0) + n
是否有重复计算的问题?c的组成部分,应该已经被计算过了吧?为什么还要把它部分的n累加一次?我理解这里应该直接是:
self.ngrams[len(c)][c] = n
from word-discovery.
Related Issues (12)
- 字符集 怎么来的,代码报错了 HOT 2
- 关于total的理解为何是总字数? HOT 3
- 卡在了得到候选词 HOT 1
- 程序卡住了,请问怎么解决
- PMI计算的准确性问题
- 代码75-76行 HOT 1
- 生成的词表是单个字的形式 HOT 4
- 字符集是什么,怎么生成字符集呢 HOT 4
- ValueError: Failed to count ngrams by KenLM. HOT 8
- 如果在window or macbook pro的pycharm 操行? HOT 1
- 小数据集能跑,但 800M 的数据就卡住,请问应该如何排查? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from word-discovery.