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)
相关推荐
草莓熊Lotso44 分钟前
《算法闯关指南:动态规划算法--斐波拉契数列模型》--01.第N个泰波拉契数,02.三步问题
开发语言·c++·经验分享·笔记·其他·算法·动态规划
AI绘画哇哒哒3 小时前
【收藏必看】大模型智能体六大设计模式详解:从ReAct到Agentic RAG,构建可靠AI系统
人工智能·学习·ai·语言模型·程序员·产品经理·转行
小奶包他干奶奶7 小时前
Webpack学习——Loader(文件转换器)
前端·学习·webpack
小奶包他干奶奶7 小时前
Webpack学习——原理理解
学习·webpack·devops
励志成为美貌才华为一体的女子7 小时前
强化学习PPO和GRPO逻辑学习
学习
meichaoWen8 小时前
【Vue3】vue3的全面学习(一)
前端·javascript·学习
FFF团团员9098 小时前
树莓派学习笔记3:LED和Button
笔记·学习
碧海潮生_CC8 小时前
【CUDA笔记】04 CUDA 归约, 原子操作,Warp 交换
笔记·cuda
摇滚侠9 小时前
2025最新 SpringCloud 教程,从单体到集群架构,笔记02
笔记·spring cloud·架构
风123456789~9 小时前
【OceanBase专栏】OB背景知识
数据库·笔记·oceanbase