Code Monkey home page Code Monkey logo

pyhan's Introduction

pyHan

介紹

此專案爬取中國時報、聯合報 及 Yahoo新聞的新聞資料,並對新聞進行分詞,最終產生各種長度的詞彙頻率。

分詞

本專案首先以 Ngrams 產生初步的 辭彙庫,並基於 ngrams 詞彙庫來進行 Maximum Matching 分詞產生另一組辭彙庫。

爬蟲

主要是針對新聞網站提供的 RSS 去爬取資料,使用的函式庫包括:

  • feedparser: 解析 RSS feed
  • urllib and requests: 解析網址和發送 http 請求
  • beautifulsoup4: 解析 HTML

輸出

  • 此程式輸出長度為 2 ~ 5 的詞彙,檔案皆置於 output/
  • output/lexicon: 裡面有 MM.json 及 Ngrams.json 兩個檔案,分別紀錄了兩種分詞方法所產生的詞彙
  • output/stats/grams: 此路徑中含有 ngrams 方法統計出的日、月、年熱門詞彙

pyhan's People

Contributors

ckybonist avatar

Watchers

 avatar  avatar

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.