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)
相关推荐
xian_wwq3 分钟前
【学习笔记】「大模型安全:攻击面演化史」第 02 篇-越狱攻防战
笔记·学习
数智工坊3 分钟前
【ROS 2 全栈入门指南三】:Action、参数与Launch文件全链路指南
android·stm32·嵌入式硬件·学习·机器人
Kobebryant-Manba8 分钟前
学习automl
学习
J.Kuchiki20 分钟前
【PostgreSQL 内核学习:平衡 K 路归并(Balanced k-way Merge)】
数据库·学习·postgresql
xieliyu.28 分钟前
MySQL 全套入门笔记:基础、库操作、数据类型
数据库·笔记·mysql
XGeFei29 分钟前
【Fastapi学习笔记(7)】—— Fastapi 中间件、前端跨域请求
笔记·学习·fastapi
问心无愧051339 分钟前
ctf show web入门109
android·前端·笔记
踏着七彩祥云的小丑41 分钟前
嵌入式测试学习第 31 天:兼容性测试:版本兼容、外设兼容、硬件版本兼容
单片机·嵌入式硬件·学习
hans汉斯42 分钟前
【人工智能与机器人研究】基于分层控制的多智能体编队协同控制
网络·人工智能·学习·yolo·机器人
Kobebryant-Manba1 小时前
学习模型构造
python·深度学习·学习