Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
B3 コアタイム 第2回目 ( 2014年11月25日(火) )
Search
yoshii25
November 25, 2014
Education
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
B3 コアタイム 第2回目 ( 2014年11月25日(火) )
yoshii25
November 25, 2014
More Decks by yoshii25
See All by yoshii25
文献紹介 (05/13/2016)
yoshii25
0
120
文献紹介 ( 02/18/2016 )
yoshii25
0
190
文献紹介 ( 2015年7月8日(水) )
yoshii25
0
190
文献紹介 ( 2015年6月10日(水) )
yoshii25
0
200
文献紹介 ( 2015年5月12日(火) )
yoshii25
0
190
文献紹介 ( 2015年4月1日(水) )
yoshii25
0
220
B3 勉強会 第12回目 ( 2015年3月26日(木) )
yoshii25
0
190
B3 勉強会 第10回目 ( 2015年3月13日(金) )
yoshii25
0
190
B3 勉強会 第8回目 ( 2015年2月20日(金) )
yoshii25
0
210
Other Decks in Education
See All in Education
[2026前期火5] 論理学(京都大学文学部 前期 第6回)「かつとまたはの規則」
yatabe
0
480
sepm-training-sample
levii
0
160
2026年度春学期 統計学 第11回 分布の「型」を考える - 確率分布モデルと正規分布 (2026. 6. 11)
akiraasano
PRO
0
170
[2026前期火5] 論理学(京都大学文学部 前期 第12回)「証明を走らせる:カリー・ハワード対応」
yatabe
0
260
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
230
Data Management and Analytics Specialisation
signer
PRO
0
1.9k
Πλουτοκρατία: Η Τυραννία του Μαμμωνά και η Μεταανθρώπινη Δουλεία
amethyst1
0
290
【デザイナー就活講座】 デザイナー就活市場・企業探し・ポートフォリオのポイント
koheihasebe
0
430
[2026前期火5] 論理学(京都大学文学部 前期 第13回)「走って、止まって、積み上がる」
yatabe
0
180
Examen de Selectividad. Geografía julio 2026 (Convocatoria Extraordinaria). UCLM
juanmartin2026
1
12k
学習者データを「見る」:外国語教師のためのデータの入力、分析、解釈方法
uranoken
0
240
Catecismo 26 #2 - Do Credo; Introdução ao 1º artigo
cm_manaus
0
190
Featured
See All Featured
KATA
mclloyd
PRO
35
15k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
800
Building AI with AI
inesmontani
PRO
1
1.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
290
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
490
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.2k
Transcript
B3ίΞλΠϜ (201411݄25(Ր)) ʰೖ ࣗવݴޠॲཧʱ ɹɹ1ষ ݴޠॲཧͱPython Ԭٕज़Պֶେֶ ࣗવݴޠॲཧݚڀࣨ B3 ழມ
ܚथ
ςʔϚ
ςʔϚ ❖ PythonͷπʔϧͱςΫχοΫ ❖ NLTKͷ༻ํ๏ ❖ ؆୯ͳ౷ܭॲཧ
Python
Python ❖ Pythonͷར ❖ ߏจҙຯͷཧղ͕ฏқ ❖ จࣈྻΛऔΓѻ͏͕ؔ๛ ❖ Pythonͷಛ ❖
มͷܕͷએݴ͕ෆཁ ❖ ߏจʹΠϯσϯτΛ༻͢Δ https://www.python.org/community/logos/
NLTK
NLTK ❖ ࢺͷλά͚, ߏจղੳ, ςΩε τͷྨͱ͍ͬͨॲཧΛߦ͏Πϯ λʔϑΣΠε ❖ ෳࡶͳΛղͨ͘ΊʹΈ߹Θ ͤΔ͜ͱ͕Ͱ͖Δ࣮
Natural Language Toolkit
༻͢Δલʹ ❖ NLTKͷΠϯϙʔτ ❖ >>> import nltk ❖ ςΩετͷΠϯϙʔτ ❖
>>> from nltk.book import *
NLTKͷػೳ ❖ ςΩετͷݕࡧ ❖ >>> text.concordance(“hoge1”) ❖ >>> text.concordance([“hoge1”, “hoge2”])
❖ ୯ޠΛ͑Δ ❖ >>> text.count(“hoge”)
NLTKͷػೳ ❖ ޠኮΛ͑Δ ❖ >>> len(text) ❖ ޠኮͷऔಘ ❖ >>>
set(text) ❖ ޠኮͷιʔτ ❖ >>> sorted(set(text))
NLTKͷػೳ ❖ ؔͷఆٛ ❖ ྫ) ςΩετͷޠኮͷ๛͞ ❖ >>> def function(text)
: ❖ . . . return len(text) / len(set(text))
Python ͖ͭͮ
Pythonͷػೳ ❖ Ϧετ ❖ ςΩετͳͲΛऩೲ͢ΔྻͷΑ͏ͳͷ. ❖ >>> sent[“hoge1”, “hoge2”, “hoge3”,
“hoge4”]
Ϧετ ❖ Ϧετͷ࿈݁ ❖ >>> sent1[“hoge1”, “hoge2”] + sent2[“hoge3”, “hoge4”]
❖ ϦετͷՃ ❖ >>> sent.append(“hoge”) ❖ εϥΠγϯά ❖ >>> sent[5 : 8]
Pythonͷػೳ ❖ จࣈྻ ❖ Ճࢉ, ࢉͳͲՄೳ. ࿈݁, ׂͷػೳΛ࣋ͭ. ❖ name
= ‘Hoge’
จࣈྻ ❖ จࣈྻͷ࿈݁ ❖ >>> ‘ ‘ .join([‘Hoge1’, ‘Hoge2’]) ❖
จࣈྻͷׂ ❖ >>> ‘Hoge1 Hoge2’.split()
Pythonͷػೳ ❖ ݅ࣜ ❖ ༻๏Cݴޠͱ΄΅ಉ༷. ൣғΛΠϯσϯτͰஅ. ❖ >>> if len(word)
< 5 ❖ . . . print ‘word length is less then 5’
݅ࣜ ❖ ୯ޠൺֱʹ͑Δԋࢉࢠ ❖ s.startswitch(t) s ͕ t Ͱ࢝·Δ͔Ͳ͏͔ ❖
s.endswitch(t) s ͕ t ͰऴΘΔ͔Ͳ͏͔ ❖ t in sɹɹɹɹɹ s ͷதʹ t ؚ͕·ΕΔ͔Ͳ͏͔ ❖ s.islower() s ͷதʹେจࣈؚ͕·Ε͍ͯͳ͍ ❖ s.isupper() s ͷதʹࢠจࣈؚ͕·Ε͍ͯͳ͍ ❖ s.isalpha() s ͷதͷจࣈ͕શͯΞϧϑΝϕοτ͔Ͳ͏͔ ❖ s.isalnum() s ͷதͷจࣈ͕શͯΞϧϑΝϕοτ͘͠ࣈ͔Ͳ͏͔
݅ࣜ ❖ ୯ޠൺֱʹ͑Δԋࢉࢠ ͖ͭͮ ❖ s.isdigit() s ͷதͷจࣈ͕શͯࣈ͔Ͳ͏͔ ❖ s.istitle()
s ͕λΠτϧέʔε͔Ͳ͏͔
Pythonͷػೳ ❖ ݅ذ ❖ ༻๏Cݴޠͱ΄΅ಉ༷. ಉ͘͡ൣғΛΠϯσϯτͰஅ. ❖ >>> for i
in range(10) ❖ . . . print i
؆୯ͳ౷ܭॲཧ
؆୯ͳ౷ܭॲཧ ❖ සग़͢Δ୯ޠΛऔΓग़͢ ❖ >>> fdist1 = FreqDist(text) ❖ ςΩετதͷҟͳΓޠΛऔΓग़͢
❖ >>> vocaburaly1 = fdist1.keys()
؆୯ͳ౷ܭॲཧ ❖ ςΩετͷ༰Λද͢୯ޠΛऔΓग़͍ͨ͠. ❖ → औΓग़ͨ͠୯ޠ͔ΒςΩετͷ༰͕ཧղͰ͖Δʂ
؆୯ͳ౷ܭॲཧ ❖ ‘,’ ‘the’, ‘.’, ‘and’ͳͲจࣈ͕͍୯ޠ͕සग़͢ΔͳΒ, 1ճ͠ ͔ొ͠ͳ͍୯ޠΛ୳ͤΑ͍ͷͰʁ ❖
15จࣈҎ্ͷ୯ޠΛऔΓग़͢ ❖ >>> V = set(text1) ❖ . . . long_words = [w for w in V if len(w) > 15]
؆୯ͳ౷ܭॲཧ ❖ 1ճ͔͠ొ͠ͳ͍୯ޠ,จ຺͔Βཧղ͠ͳ͚ΕͳΒͳ͍୯ޠ͕ ଟ͘, ςΩετͷ༰ཧղͰ͖ͳ͍. ❖ 7จࣈҎ্, 7ճҎ্ొͨ͠୯ޠΛऔΓग़͢ ❖ >>>
fdist5 = FreqDist(text5) ❖ >>> sorted([w for w in set(text5) if len > 7 and fdist5[w] > 7])