Comments (3)
Hello @myroslavarm,
Could you provide a use case scenario in which you need to access the table of n-gram counts?
Because this table is hidden by design: it is an implementation detail of the NgramModel which should not be accessible through public API
from ngrammodel.
The use case i had in mind was to be able to access the table in order to cut off some of the results (for example, if you want to leave only the results with frequencies above a certain threshold). If this is by design and you don't want people to modify the tables for their own use, then maybe there should be some implementation from within the ngram model that would handle cases like this.
from ngrammodel.
OK. You are right! But the private properties should not be accessible from outside. The way I see it (I might be wrong), it is the responsibility of the NgramModel to perform the filtering after (or as part of) the training.
So you have two options:
- Create a subclass of NgramModel and add the filtering functionality to this class
- Update the current implementation of NgramModel and make a PR.
I think you should do the latter because indeed the filtering option could be very useful for many applications of the NgramModel.
from ngrammodel.
Related Issues (19)
- Remove TextGenerator and Corpora from this repository
- Implement Good-Turing smoothing
- Implement Kneser-Ney smoothing
- Change configurations of CI from Pharo 6, 7, 8 to Pharo 7, 8, 9
- Update README
- Change olekscode to pharo-ai in baseline
- Fails to parse n-grams when reading from file if n-grams contain commas
- Saving frequencies as Dictionaries may be faster than Bags HOT 1
- Add functionality for filtering the table of ngrams
- Vocabulary needs to also be shortened in #removeNgramsWithCountsLessThan: HOT 1
- Create bigram from String
- Use the AI prefix for all the classes
- Examples in README are out of date
- Use GitBridge to access corpus
- Improve test coverage in NgramModel
- Add writing to and reading from file for NgramModel
- Infer the order of n-grams when reading count dictionaries from files
- Write tests for reading and writing ngram models to files
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 ngrammodel.