語言分析與資料科學
  • 本書規劃
  • PART I:基礎知識
    • 導論
    • 語言學
      • 語言的實證研究方法
    • 數學與統計
      • 統計
        • 機率與機率分佈
          • 推論統計
        • 迴歸模型
      • 線性代數
    • 自然語言處理
      • 語料庫
    • 機器學習
      • kNN
      • Probabilistic learning using Naive Bayes
      • 決策樹 Decision Trees
      • 支持向量機 Support Vector Machines
      • 迴歸分析 Regression models
      • 神經網路與深度學習 Neural Network and Deep Learning
      • 關聯規則挖掘 Association Rules
      • k-means 分群 Clusterings
      • 社會網路分析
    • 資料科學的 OSEMN 模式
  • PART II: 文本分析:資料處理、表徵與語意計算
    • 文本分析是什麼
      • 程式處理架構
    • 文本前處理
      • 文本收集
      • 文本清理
      • 自動分詞與詞類標記
      • 文本標記
    • 文本數據探索性分析
    • 文本語意與統計
      • 語意表徵
      • 文本訊息視覺化
      • 文本相似與關聯
    • 文本知識抽取
  • PART III:文本分析:模型應用與專案
    • 文本迴歸預測
    • 文本分類
      • 情緒分析
      • 垃圾訊息偵測
    • 文本自動生成
      • 自動摘要
    • 文本聚類
    • 主題模型
    • 立場、意圖與價值
    • 個人文體風格
    • 文本真實性
      • 重複文本偵測
    • 資料科學報告與部署
  • 附錄
    • R 存活指令
    • Python 存活指令
    • Git and Github 入手
    • Linux 存活指令
    • 正則表示法
    • 參考書目
Powered by GitBook
On this page

Was this helpful?

  1. PART II: 文本分析:資料處理、表徵與語意計算
  2. 文本前處理

文本收集

  • 建立文本語料庫「前處理」的第一步。

  • 數據來源很多元

    • files that you can download

    • APIs

    • content such as HTML tables

    • custom data browsers

    • and more.

# 工作路徑
# windows example
setwd("C:\\Users\\shukai\\Documents\\corpus")
# linux/MacOS example
setwd("~/Dropbox/Linguistic.Analysis.and.Data.Science/corpus")

# get listing of .txt files in directory
filenames <- list.files(getwd(), pattern="*.txt")

# read files into a character vector
files <- lapply(filenames, readLines)
  • 如果需要從網路抓取(大半部分的情形),則需要了解一些網路的運作原理。不過爬蟲行為 (crawler/spider/web scraping) 還有涉及「侵入他人動產」的法律爭議。

  • 市面上也出現越來越多的網路爬蟲服務,如 蟲數據 (chong data)、 Kimonolab 等,可斟酌。

網頁成份擷取

  • 了解 HTTP protocol

  • RCurl

  • Regular expression

可以利用 rvest

  • rvest scrapes html from web pages, and is designed to work with magrittr to make it easy to express common web scraping tasks.

Previous文本前處理Next文本清理

Last updated 5 years ago

Was this helpful?