人気ブログランキング | 話題のタグを見る

したっぱ昆虫細胞研究者のメモ

insectcell.exblog.jp
ブログトップ
2013年 12月 06日

NLTKで論文を読んでみた

今日の材料はこれ
Transcriptome Responses of Insect Fat Body Cells to Tissue Culture Environment

映画「The Social Network」の脚本をNLTKで解析して遊んでみたや、
「魔法少女まどか☆マギカ」の台詞をNLTK(Natural Language Toolkit)で解析するに習ってやってみました。
途中グラフ描くのがやばかったので、Matpotlibのインストールで詰んだあたなへを参考にEPDを使って楽しました。

論文のテキストをコピーペーストし、'pc論文.txt' として保存しました。
iPythonを起動し、

#20131206追記
import nltk
from nltk.book import *

#データの読み込み
raw=o p e n ('pc論文.txt').read()
#単語認識
tokens=nltk.word_tokenize(raw)
text=nltk.Text(tokens)

#単語数
len(tokens)
Out[12]: 5791

#語彙数
tokens_1 = [w.lower() for w in tokens] #20131206修正('s/I/1/g')
len(set(tokens_1))
Out[14]: 1935

訳2000単語知ってれば論文が書ける!!

#何回'cell' って言ってるか
tokens_1.count('cell')
Out[15]: 36

tokens_1.count('cells')
Out[16]: 27

tokens_1.count('fat')
Out[17]: 81

tokens_1.count('body')
Out[18]: 70

bodies がいる予感...

#culture とprimary が含まれる文
text.concordance("culture" and "primary",lines=5)
Displaying 5 of 8 matches:
es. Cell lines are established from primary culture of tissue when a population
roliferating cells derived from the primary tissue explant undergo immortalizat
undergo immortalization [ 5 ] . In primary cultures of insect cells , it usual
ught that during the early stage of primary culture , isolated explants activat
ant are different from cells in the primary tissue. Champy ( 1913 ) proposed th

#単語の分布をみる
fdist=nltk.FreqDist(w.lower() for w in text)
fdist.plot(50,cumulative=True)

NLTKで論文を読んでみた_e0160319_6553397.png


よく出てくる単語の出てくるタイミングがみたくなりますね。

#単語を指定
terms=['cells','cell','transcriptome','genes','culture','intact']

#指定した単語の分布を見る
text.dispersion_plot(terms)

transcriptomeについて話してからgenesに移行するのが多いらしい
NLTKで論文を読んでみた_e0160319_6564779.png


人気ブログランキングに参加しています。
応援よろしくお願いします。
FC2 Blog Ranking


by koretoki | 2013-12-06 10:20


<< gen. pre.      ホルマリン固定パラフィン包埋な... >>