Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
B3 コアタイム 第6回目 ( 2014年12月09日(火) )
Search
MIKAMI-YUKI
December 08, 2014
Education
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
B3 コアタイム 第6回目 ( 2014年12月09日(火) )
MIKAMI-YUKI
December 08, 2014
Transcript
19 slides
「入門 自然言語処理」 5章:単語の分類とタグ付け B3 三上侑城
もくじ •タガーの利用 •タグ付きコーパス •ディクショナリ(重要) •自動タグ付け •Nグラムタグ付け
タガーの利用 ・品詞タガー それぞれの単語に品詞のタグを付ける。 >>> text = nltk.word_tokenize(“And now for something
completely different") >>> nltk.pos_tag(text)
タガーの利用 ここで出てくる分類名の意味 詳細は以下のようにタグを指定する。 >>> nltk.help.upenn_tagset(’CC’) 分類名 意味 CC 等位接続詞 RB
副詞 IN 前置詞 NN 名詞 JJ 形容詞
タグ付きコーパス ・str2suple() タグ付きトークンに変換 >>> tagged_token = nltk.tag.str2tuple('fly/NN') >>> tagged_token >>>
tagged_token[0] >>> tagged_token[1]
タグ付きコーパス ・タグ付きコーパスを読み込む NLTKにはタグ付きのサンプルがある。 例 >>> nltk.corpus.brown.tagged_words() >>> nltk.corpus.nps_chat.tagged_words()
ディクショナリ(P204~) ・ディクショナリ型と呼ばれるデータ型 ・リストには整数の添字を使ってアクセス ・マップ、ハッシュ、ハッシュマップとも 呼ばれる
ディクショナリ >>> pos = {} >>> pos >>> pos['colorless'] =
'ADJ' >>> pos >>> pos['ideas'] = 'N' >>> pos['sleep'] = 'V' >>> pos['furiously'] = 'ADV' >>> pos
ディクショナリ ・キー指定で値を得る >>> pos['ideas'] >>>pos['colorless'] ・ないものはエラーが出る。 >>>pos['green']
ディクショナリ ・リストに変換 >>> list(pos) ・キーを整列させる >>> sorted(pos)
ディクショナリ ・最後にsがつくものを探す >>> [w for w in pos if w.endswith('s')]
・ディクショナリの中身を全て表示 >>> for word in sorted(pos): ... print word + ":", pos[word]
ディクショナリ ・キーの一覧メソッド >>> pos.keys() ・値の一覧メソッド >>> pos.values() ・ペアの一覧メソッド >>> pos.items()
ディクショナリ ・ディクショナリを定義 >>> pos = {'colorless':'ADJ','ideas':'N','sleep' :'V','furiously':'ADV'}
ディクショナリ ・デフォルトディクショナリ 存在しないものにアクセス 通常→エラー デフォルトディクショナリ→自動生成 nltk.defaultdict()を使用する
ディクショナリ ・デフォルトディクショナリ 整数型の場合 >>> freq1 = {} >>> freq1['colorless'] =
4 >>> freq1['ideas'] #エラーが出る >>> freq2 = nltk.defaultdict(int) >>> freq2['colorless'] = 4 >>> freq2[‘ideas’] #エラーは出ない
ディクショナリ ・デフォルトディクショナリ リスト型の場合 >>> pos1 = {} >>> pos1['sleep'] =
['N','V'] >>> pos1['ideas'] #エラーが出る >>> pos2 = nltk.defaultdict(list) >>> pos2['sleep'] = ['N','V'] >>> pos2[‘ideas’] #エラーは出ない
ディクショナリ ・デフォルトディクショナリ デフォルト値の設定 >>> pos = nltk.defaultdict(lambda:'N') >>> pos['colorless'] =
'ADJ' >>> pos['blog'] #Nが自動的に入る >>> pos.items()
自動タグ付け ・テキストに自動的に品詞タグを付け てくれる。 ・様々なタガーがあり、それぞれに 特徴がある。 ・必要となった時に参照してもらい たい(P214~)
Nグラムタグ付け ・文脈を考慮してタグを付けてくれる ・いくつかのタガーを組み合わせて 使い、精度を高められる。 ・必要となった時に参照してもらい たい(P219~)
More Decks by MIKAMI-YUKI
See All by MIKAMI-YUKI
2016年_年次大会_発表資料
mikamiy
0
140
文献紹介_10_意味的類似性と多義解消を用いた文書検索手法
mikamiy
0
360
文献紹介_9_コーパスに基づく動詞の多義解消
mikamiy
0
140
文献紹介_8_単語単位による日本語言語モデルの検討
mikamiy
0
110
文献紹介_7_自動獲得した未知語の読み・文脈情報による仮名漢字変換
mikamiy
0
130
文献紹介_6_複数の言語的特徴を用いた日本語述部の同義判定
mikamiy
0
120
文献紹介_5_マイクロブログにおける感情・コミュニケーション・動作タイプの推定に基づく顔文字の推薦
mikamiy
0
170
文献紹介_4_結合価パターンを用いた仮名漢字変換候補の選択
mikamiy
0
420
文献紹介_3_絵本のテキストを対象とした形態素解析
mikamiy
1
430
Other Decks in Education
See All in Education
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 1
hiola
0
13k
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
190k
El Geoparque Mundial UNESCO Volcanes de Calatrava de la Investigación Científica a la Transposición Didáctica en el aula
juanmartin2026
1
58k
Concours Photo - UGE - 2026
echaille
0
190
自己紹介 / who-am-i
yasulab
6
7.5k
Longitudinal research
aisw77
0
440
吉岡研究室紹介(2026年度)
kentaroy47
0
670
Session 8 - Teknik Lobby dan Negosiasi
adeputra13
0
150
Liburd and Stoll Farrell "Copyright Essentials From A to AI: A 2026 NISO Training Series, Session Two: Fair Use and the Public Domain"
baltimoreniso
0
200
2026年度秋学期 統計学 第4回 データを「分布」で見る (2026. 10. 20)
akiraasano
PRO
0
210
2026年度秋学期 統計学 第5回 分布をまとめるー記述統計量(平均・分散など) (2026. 10. 27)
akiraasano
PRO
0
220
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
3
3.6k
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
600
Faster Mobile Websites
deanohume
310
32k
Skip the Path - Find Your Career Trail
mkilby
1
290
A Soul's Torment
seathinner
9
3.9k
Embracing the Ebb and Flow
colly
88
5.2k
How to Talk to Developers About Accessibility
jct
2
620
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
340
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
610
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
680
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k