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)
相关推荐
龙文浩_4 小时前
Attention Mechanism: From Theory to Code
人工智能·深度学习·神经网络·学习·自然语言处理
守护安静星空4 小时前
esp32开发笔记-工程搭建
笔记·单片机·嵌入式硬件·物联网·visual studio code
ljt27249606614 小时前
Compose笔记(七十七)--视频录制
笔记·android jetpack
爱上好庆祝6 小时前
svg图片
前端·css·学习·html·css3
嵌入式小企鹅6 小时前
蓝牙学习系列(八):BLE L2CAP 协议详解
网络·学习·蓝牙·ble·协议栈·l2cap
周周不一样6 小时前
Andorid基础笔记2-jar&反射
笔记·pycharm·jar
jiayong237 小时前
第 8 课:开始引入组合式函数
前端·javascript·学习
智者知已应修善业7 小时前
【51单片机单按键切换广告屏】2023-5-17
c++·经验分享·笔记·算法·51单片机
格鸰爱童话7 小时前
向AI学习项目技能(五)
java·学习
技术人生黄勇8 小时前
拆解 Hermes Agent:开源 Agent 里唯一的闭环学习系统
学习