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)
相关推荐
Byron__2 小时前
AI学习_06_短期记忆与长期记忆
人工智能·python·学习
ysa0510303 小时前
【并查集】判环
c++·笔记·算法
试剂界的爱马仕4 小时前
Anti-mouse PD-1 mAb (Clone RMP1-14) 与 Axitinib 小鼠实验使用方案整理汇总
大数据·人工智能·深度学习·学习
Gp7HH6hrE4 小时前
OpenAI 与 Anthropic 开放公共学习平台
人工智能·学习·chatgpt
FakeOccupational5 小时前
【电路笔记 通信】IEEE 1588精密时间协议(PTP):时间戳格式+精确到ns的时间表示与处理
笔记
kaixin_learn_qt_ing5 小时前
2026.7.3---学习记录
学习
99乘法口诀万物皆可变6 小时前
PcanToVectorXL_V01:打通 Vector 与 PCAN 的双向 CAN/CAN‑FD 桥梁
c++·学习
MartinYeung56 小时前
[论文学习] CAMIA:下文感知成员推理攻击
人工智能·深度学习·学习
secondyoung6 小时前
Cortex-R52学习:存储系统
arm开发·单片机·学习·arm
科技IT杂谈7 小时前
2026年智能体与定制工具平台观察:五个平台的路径与场景
学习