語料收集

  • 語料庫是一個 self-contained 的語言物件。

  • 任何形式的語言實現素材,如語音,口語,書面文本,或神經心理語言實驗資料,都可以視為是「語言資料」(linguistic data)。

  • 將「語言資料」數位化處理,並加以自動或手工標記語言訊息的資料庫,謂之語料庫 (corpus)。

  • 統計上來說,是個語言樣本。

目前已經有許多地方可以拿到開源的語料庫。

http://www.helsinki.fi/varieng/CoRD/
http://linghub.org/
http://datahub.io/

語料怎麼蒐集

  • 人工手動亂蒐(廣蒐)法

  • 程式自動化蒐集

    • wget

    • 市面上的爬蟲程式

      • import.io: Instantly Turn Web Pages into Data.

      • Kimono: Turn websites into structured APIs from your browser in seconds

      • Blockspring: Access web services from spreadsheets.

語言學家寫的套件

單機版

bootcat :Simple Utilities to Bootstrap Corpora And Terms from the Web

  • 開發者是計算語言學家,更能考量到語言分析的方法,該網站也提供了詳盡的步驟與適用各個平台的前端介面。

  • The BootCaT toolkit implementS an iterative procedure to bootstrap specialized corpora and terms from the web, requiring only a list of 'seed terms' (terms that are expected to be typical of the domain of interest) as input.

  • It is modular in that one can easily run a subset of the programs, look at intermediate output files, add new tools to the suite, or change one program without having to worry about the others.

  • The BootCaT front-end is a graphical interface for the BootCaT toolkit, it's basically just a wizard that guides you through the process of creating a simple web corpus. (advanced users comfortable with text UIs should consider using the Perl scripts instead of the front-end)

安裝畫面

boot
  • 目前用 bing 來搜尋網頁,申請一個免費帳號一個月容許 5000 筆 query(一個 tuple 算一個)

  • 抓回來的文本基本上有清理過,但是還是存在許多雜訊。

  • 在指令列的版本比較好。其中 readme 中提到還可以繼續做 (英語) 的 pos tagging 和 cwb-indexed。

word sketch engine web corpus / parallel corpora

所以如果要利用 bootcat 或是 wse來建立中文語料庫,需要

  • 前處理的程式

    • 斷詞 (word segmentation)

    • 詞類自動標記 (POS tagging)

  • 語料建立索引的程式

spiderling: A web spider for linguists

問題是,每個人的需求不同,要處理的語料不同,來源與格式差異很大。最靈活的還是會寫程式。

程式自動化蒐集

以下介紹用 RPython 網撈語料的簡單方式。

多線語料網撈 (web crawler for corpus linguistics)

  • 如果妳的目的是建立大規模,持續更新等級的語料庫,可以考慮語言學家寫的套件。以下介紹 COPENS 的作法。

    • 利用 spiderling 雲端動態多來源更新語料 (代表性新聞媒體,批踢踢,等等)

    • 容許上傳自建語料庫

    • 跟政府要開放語料 (公視,原民台,中央通訊社,。。。)

spiderling 架構

architecture work.flow data.flow

Last updated

Was this helpful?