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)
相关推荐
AI成长日志1 小时前
【datawhale】hello agents开源课程学习记录第5章 智能体应用实践:低代码平台构建指南
学习·低代码·开源
GHL2842710902 小时前
RAG相关问题整理学习
学习·ai
程序员夏末2 小时前
【LeetCode | 第七篇】算法笔记
笔记·算法·leetcode
开源盛世!!3 小时前
3.23-3.25笔记
笔记
hanlin035 小时前
刷题笔记:力扣第43、67题(字符串计算)
笔记·算法·leetcode
多看书少吃饭5 小时前
Vue + Java + Python 打造企业级 AI 知识库与任务分发系统(RAG架构全解析)
java·vue.js·笔记
了一梨6 小时前
[T113] 交叉编译 OpenCV 4.5.2 + face 模块
linux·笔记·opencv
知识分享小能手6 小时前
MongoDB入门学习教程,从入门到精通,MongoDB创建、更新和删除文档(3)
数据库·学习·mongodb
困死,根本不会6 小时前
VMware Ubuntu 显示有线连接却无法上网|完整排查与解决笔记
linux·笔记·ubuntu
诗句藏于尽头6 小时前
基于GPT2的底模微调实现微信聊天风格模仿输出
学习·微信