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)
相关推荐
汇智信科4 小时前
Java 开发汇智网络化学习系统 (E‑Learning) 技术特性与应用场景解析
人工智能·学习·架构·汇智信科·fastclaw·汇智龙虾
苏子寒5 小时前
Nano-VLLM全代码解析笔记(8)-qwen3与qwen3_moe
笔记·python·深度学习·ai·性能优化·vllm
Wang's Blog5 小时前
PostgreSQL笔记64:分区插件生态与扩展查询协议深度解析
数据库·笔记·postgresql
poiu12346575 小时前
中医执业医师考试如何选择培训课程|2026主流机构客观测评
学习
MartinYeung55 小时前
[论文学习]BadRobot:物理世界中具身大语言模型智能体的越狱攻击
人工智能·学习·语言模型
影寂ldy5 小时前
Modbus-ASCII 协议 + LRC校验
笔记·网络协议·c#
YM52e5 小时前
鸿蒙 ArkTS 实战|万能绿茶通用词汇库:20 词六大类 + 搜索筛选 + 潜台词解析
学习·华为·harmonyos
Three_ST5 小时前
沐神-动手学习深度学习-习题答案4.4模型选择,欠拟合,过拟合
人工智能·python·深度学习·学习·算法
01_ice5 小时前
前端学习JS(3)
前端·javascript·学习
金立基包装胶水5 小时前
纸袋封口热封胶不粘是什么原因?
大数据·笔记·其他