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)
相关推荐
小新同学^O^8 小时前
简单学习 --> 模型参数
学习·llm·大模型参数
cdbqss18 小时前
VB2026 菜单生成基类 BqGetMenuStrip
数据库·经验分享·学习·oracle·vb
智者知已应修善业9 小时前
【51单片机8位数码管动态显示日期小数点风格】2023-11-13
c++·经验分享·笔记·算法·51单片机
智者知已应修善业9 小时前
【51单片机有三个LED 分别第一个灯闪三下 再到第二个灯又闪三下 再到第三个灯又闪三下 就这样循环程序】2023-11-16
c++·经验分享·笔记·算法·51单片机
暴躁小师兄数据学院9 小时前
【AI大数据工程师特训笔记】第04讲:PostgreSQL 数据库内置函数详解
大数据·数据库·笔记·ai·语言模型
吃好睡好便好10 小时前
创建魔方矩阵和单位矩阵
开发语言·人工智能·学习·线性代数·matlab·矩阵
星夜夏空9910 小时前
STM32单片机学习(21) —— I2C通信
stm32·单片机·学习
z落落12 小时前
C# 数组 最终完整版全套笔记(一维+多维+交错+引用类型+对象数组)
java·笔记·c#
searchforAI12 小时前
B站视频转笔记用哪个工具?2026年四款AI笔记工具对比实测
人工智能·经验分享·笔记·gpt·学习·视频总结·ai笔记
爱上好庆祝13 小时前
学习JS第十一天(JS的进阶)
前端·javascript·学习