NLTK にはコーパスのサンプルがいくつか付属しています: http://nltk.googlecode.com/svn/trunk/nltk_data/index.xml
エンコーディングなしでテキストのみが必要です。そのようなコンテンツを抽出する方法がわかりません。私が抽出したいのは
1) nps_chat: 解凍後のファイル名は 10-19-20s_706posts.xml のようになります。このようなファイルは、次のような XML 形式です。
<Posts>
<Post class="Statement" user="10-19-20sUser7">now im left with this gay name<terminals>
<t pos="RB" word="now"/>
<t pos="PRP" word="im"/>
<t pos="VBD" word="left"/>
<t pos="IN" word="with"/>
<t pos="DT" word="this"/>
<t pos="JJ" word="gay"/>
<t pos="NN" word="name"/>
</terminals>
</Post>
...
...
私はその実際の投稿だけが欲しい:
now im left with this gay name
ローカルディスクでエンコーディングを削除した後、NLTK または (何でも) 裸の投稿を保存するにはどうすればよいですか?
2) 配電盤のトランスクリプト。このタイプのファイル (ファイル名は解凍後の談話) には、次の形式が含まれます。私が望むのは、前のマーカーを取り除くことです:
o A.1 utt1: Okay, /
qy A.1 utt2: have you ever served as a juror? /
ng B.2 utt1: Never. /
sd^e B.2 utt2: I've never been served on the jury, never been called up in a jury, although some of my friends have been jurors. /
b A.3 utt1: Uh-huh. /
sd A.3 utt2: I never have either. /
% B.4 utt1: You haven't, {F huh. } /
...
...
私だけが欲しい:
Okay, /
have you ever served as a juror? /
Never. /
I've never been served on the jury, never been called up in a jury, although some of my friends have been jurors. /
Uh-huh. /
I never have either. /
You haven't, {F huh. } /
...
...
事前にどうもありがとうございました。