This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ky from "ky"; | |
const baseApi = ky | |
.create({ | |
prefixUrl: "http://localhost:8080", | |
headers: { "Content-Type": "application/json" }, | |
}); | |
type TodoList = { | |
items: Todo[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import time | |
import uuid | |
from azure.storage.blob import BlobServiceClient, ContainerClient, __version__ | |
# ストレージアカウントの接続文字列 | |
connect_str = "" | |
# データストレージのコンテナ名 | |
container_name = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gensim | |
words_list = [["単語", "英語"], ["日本語", "野球"], ] # 単語リストのリスト | |
max_document_frequency, min_document_frequency = 1.0, 0.0 # 単語の出現頻度の上限下限 | |
words_dictionary = gensim.corpora.Dictionary(words_list) # 単語辞書を生成 | |
words_dictionary.filter_extremes(no_above=max_document_frequency, no_below=min_document_frequency) | |
corpus = [words_dictionary.doc2bow(words) for words in words_list] # 単語辞書を使って単語リストをBoW表現にする | |
lda_model = gensim.models.ldamodel.LdaModel( | |
corpus=corpus, | |
num_topics=num_topics, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import List, Dict | |
from wordcloud import WordCloud | |
import matplotlib.pylab as plt | |
import math | |
class WordCloudGenerator: | |
def __init__(self): | |
self.word_cloud = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Dict, List, Tuple | |
import numpy as np | |
from scipy import sparse as sp | |
from word_analyze import tokenize | |
def is_key_exist(d: Dict, key: any): | |
return d.get(key) is not None |