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)
相关推荐
Y.9998 小时前
电脑黑屏只有鼠标能动
学习
智学AI8 小时前
AI博主写作素材管理方法分享:资料归集、笔记关联与文档归档
人工智能·笔记
架构师伯子明8 小时前
FFmpeg C++学习(一):编译和demo
开发语言·c++·学习
叼烟扛炮8 小时前
[LangChain] 学习笔记(02):LCEL 链式调用与动态模型配置实战
服务器·开发语言·网络·笔记·学习·langchain
weixin_448119948 小时前
Datawhale Jev Cookbook 202610 笔记5
笔记
程序员梅雨8 小时前
【从零开始学习数据仓库 | 第二篇】: 拉链表 & 数仓分层
大数据·数据仓库·学习
一木 之林9 小时前
Dify学习笔记 04 · 检索底座:Embedding、Rerank与向量数据库(第46-54集)
笔记·学习·embedding·dify
ljt27249606619 小时前
Python笔记(十一)--Numpy(一)
笔记·python·numpy
芯思路9 小时前
STM32开发学习笔记之十【AI部署】
笔记·stm32·学习
憧憬成为java架构高手的小白10 小时前
langgraph4j学习
学习