我创建了一个字典
TTR_of_speakers = defaultdict(int)
TTR_of_speakers = {}
我编写了一个程序,它执行一些计算,产生一个名为TTR的值。
for record in cwrecords:
if record["speaker_name"] == "Joe Biden":
text = record["text"]
processed = nlp(text)
textw = [t.lemma_ for t in processed]
N += len(textw)
total_types |= set(textw)
V = len(total_types)
TTR = float(V)/float(N)
如何将TTR值放入字典中,密钥为Joe Biden?