Git Product home page Git Product logo

tf-idf_tutorial's Introduction

TF-IDF(Term Frequency - Inverse Document Frequency)

Calculate cosine-similarity between documents using TF-IDF 此專案以Python3進行開發,以新聞資料進行tf-idf結合cosine similarity實作的範例

TF-IDF Introduction:

TF-IDF是一種統計方法,用以評估一字詞對於一個檔案集或一個語料庫中的其中一份檔案的重要程度。
字詞的重要性隨著它在檔案中出現的次數(TF)成正比增加,但同時會隨著它在語料庫中出現的頻率(IDF)成反比下降。

image image

Cosine Similarity Introduction:

餘絃相似度(cosine similarity)是資訊檢索中常用的相似度計算方式,可用來計算文件之間的相似度,
也可以計算詞彙之間的相似度,更可以計算查詢字串與文件之間的相似度。

image image

IDF補充:

image image

補充:

新聞資料大概只有200篇,斷詞使用jieba,有許多詞只出現在某一篇新聞文檔,考慮過濾這些詞,有可能是斷錯的詞彙。

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.