kyow / tfidf_ja Goto Github PK
View Code? Open in Web Editor NEWtfidf_jaは与えられた単語の配列の TF-IDF を算出し、単語をキー、TF-IDF値をバリューとするハッシュテーブルを返却するライブラリです。
Home Page: https://rubygems.org/gems/tfidf_ja
License: MIT License
tfidf_jaは与えられた単語の配列の TF-IDF を算出し、単語をキー、TF-IDF値をバリューとするハッシュテーブルを返却するライブラリです。
Home Page: https://rubygems.org/gems/tfidf_ja
License: MIT License
ruby本体のバージョン:ruby-1.9.2-p180(MacOS,Ubuntu環境ともに)
tfidf_jaのバージョン:2.0.0および0.1.1において
表題のとおりtfidfの値が単語によらず、同じ値になってしまいます。
具体的には
require 'rubygems'
require 'tfidf_ja'
p TfIdf::Ja.new.tfidf(['この', '文章', 'から', 'TFIDF', '値', 'を', '取得', 'する'])
の値が
# >> {"この"=>13.368957861079517, "文章"=>13.368957861079517, "から"=>13.368957861079517, "TFIDF"=>13.368957861079517, "値"=>13.368957861079517, "を"=>13.368957861079517, "取得"=>13.368957861079517, "する"=>13.368957861079517}
となってしまいます。
doc/idf.dicを見ると13.368957861079517という値はaverageとひもづいているようなので
平均値をとってきてしまっているように思われます。
非常に使ってみたいので、修正していただけるとありがたいです。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.