InternLM学习笔记

入门岛

1. Linux基础知识





2. Python 基础知识

python 复制代码
from collections import Counter


text = """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""


def wordcount(text: str):
    text = text.lower().replace('.', '').replace(',', '').replace('\n', ' ')
    words = [word[:-2] if word.endswith("'s") else word for word in text.split(' ') if word]
    return dict(Counter(words))


if __name__ == '__main__':
    res = wordcount(text)
    print(res)
相关推荐
三伏52216 分钟前
Cortex-M3重启流程——笔记
笔记·cortex-m3
方见华Richard1 小时前
方见华:在递归的暗夜里,把自己活成一束光
人工智能·经验分享·笔记·学习方法·空间计算
zzcufo1 小时前
多邻国学习笔记第五阶段第10-11部分
笔记·学习·c#
BlackWolfSky1 小时前
鸿蒙中级课程笔记2—状态管理V2—@ObservedV2装饰器和@Trace装饰器:类属性变化观测
笔记·华为·harmonyos
航Hang*2 小时前
计算机等级考试(二级WPS)---第1章:综合应用基础---第2节:PDF文件应用
笔记·学习·pdf·wps·计算机二级·计算机等级考试
zhangrelay2 小时前
Linux(ubuntu)如何锁定cpu频率工作在最低能耗模式下
linux·笔记·学习
三伏5222 小时前
Cortex-M3权威指南Cn第四、五章——笔记
笔记·cortex-m3
老神在在0012 小时前
Token身份验证完整流程
java·前端·后端·学习·java-ee
轴测君2 小时前
MobileNet V1
人工智能·pytorch·笔记
ValidationExpression3 小时前
学习:词嵌入(Word Embedding / Text Embedding)技术
python·学习·ai