コード例 #1
0
ファイル: 39.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    frequency_list = neko.frequency_list(text)
    frequencies = [freq for word, freq in frequency_list]
    x = [i for i in range(len(frequencies))]

    plt.plot(x, frequencies)
    plt.xscale('log')
    plt.yscale('log')
    plt.show()

    return
コード例 #2
0
def main():
    text = neko.read_and_map()
    frequency_list = neko.frequency_list(text)
    frequencies = [freq for word, freq in frequency_list]
    x = [i for i in range(len(frequencies))]

    plt.plot(x, frequencies)
    plt.xscale('log')
    plt.yscale('log')
    plt.show()

    return
コード例 #3
0
ファイル: 38.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    frequency_list = neko.frequency_list(text)
    hist = sorted(neko.histogram(frequency_list).items())
    # 全部出すと見えないので上位10件
    hist = hist[:10]

    x = [x for x, y in hist]
    y = [y for x, y in hist]
    plt.bar(x, y)
    plt.show()

    return
コード例 #4
0
ファイル: 38.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    frequency_list = neko.frequency_list(text)
    hist = sorted(neko.histogram(frequency_list).items())
    # 全部出すと見えないので上位10件
    hist = hist[:10]

    x = [x for x, y in hist]
    y = [y for x, y in hist]
    plt.bar(x, y)
    plt.show()

    return
コード例 #5
0
ファイル: 37.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    result = neko.frequency_list(text)
    top10 = result[:10]
    top10_freqs = [x[1] for x in top10]
    top10_surfaces = [x[0][0] for x in top10]
    print(top10_freqs)

    x = range(10)
    y = top10_freqs
    plt.bar(x, y, align="center")
    plt.xticks(x, top10_surfaces, fontproperties=fp)
    plt.show()

    return
コード例 #6
0
ファイル: 36.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    result = neko.frequency_list(text)
    print(result)

    return
コード例 #7
0
ファイル: 36.py プロジェクト: tkyf/nlp100
def main():
    text = neko.read_and_map()
    result = neko.frequency_list(text)
    print(result)

    return