バイグラム
バイグラム
バイグラムとはテキスト中に続いている単語のペア。
関数 bigrams()
>>> bigrams(['Shibata','Takada','Oh','Nagashima']) [('Shibata', 'Takada'), ('Takada', 'Oh'), ('Oh', 'Nagashima')] >>>
ConditionalFreqDist()と組み合わせて使うことで、ある単語に続いて最も使用されている単語を知ることができる。
コロケーション
コロケーション
コロケーションとは頻繁に共起する一連の単語列。 頻繁に出現するバイグラムということもできる。
関数 collocations()
>>> text1.collocations()
Building collocations list Sperm Whale; Moby Dick; White Whale; old man; Captain Ahab; sperm whale; Right Whale; Captain Peleg; New Bedford; Cape Horn; cried Ahab; years ago; lower jaw; never mind; Father Mapple; cried Stubb; chief mate; white whale; ivory leg; one hand >>>