Coder Social home page Coder Social logo

kyow / tfidf_ja Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 6.0 9.76 MB

tfidf_jaは与えられた単語の配列の TF-IDF を算出し、単語をキー、TF-IDF値をバリューとするハッシュテーブルを返却するライブラリです。

Home Page: https://rubygems.org/gems/tfidf_ja

License: MIT License

Ruby 100.00%

tfidf_ja's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tfidf_ja's Issues

tfidfの値が単語によらず、同じ値になってしまいます

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とひもづいているようなので
平均値をとってきてしまっているように思われます。
非常に使ってみたいので、修正していただけるとありがたいです。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.