- 博客(44)
- 资源 (10)
- 收藏
- 关注
原创 re 非贪婪匹配
文章摘要: 通过正则表达式非贪婪匹配(re.findall('\*\*.*?\*\*|\*.*?\*',s)),可以准确提取文本中用**或*标记的关键词。贪婪匹配会错误合并全部内容,而非贪婪模式能正确识别出三个独立片段:**人机协同:**、*智能体状态*和**人类监督**。该方法解决了符号嵌套时的匹配问题。
2025-09-03 11:57:42
191
原创 streamlit 指定端口号
在程序中,一般无需指定,默认为8501。如果程序没完全关闭时重启程序,则递增。但如果需要指定它,或者多个程序同时运行时需要不同的端口号,可以使用以下参数。
2025-08-03 11:31:21
228
原创 RuntimeError: Directory ‘static/’ does not exist
Python 3.8以上与fitz存在兼容问题。
2025-08-02 21:31:25
220
原创 Failed to initialize NVML: Driver/library version mismatch — 已解决
驱动和内核版本不匹配。原因是驱动会自动更新,而更新后造成了与内核版本不匹配。执行reboot,内核会自动更新,使版本相配。
2025-08-02 12:10:23
963
原创 Ubuntu:ssh session closed. Press any key to reconnect.
本文介绍了如何通过vim、vi或nano修改/etc/profile和sshd_config文件中的SSH连接保持设置。具体步骤包括:1)用vim打开配置文件;2)找到TMOUT、TCPKeepAlive、ClientAliveInterval参数;3)进入插入模式修改参数值;4)保存并退出。修改后的设置将每60秒发送一次保活请求,最多允许3次无响应后才断开连接,有助于维持SSH会话的稳定性。
2025-07-23 17:52:01
382
原创 安装或更新 CUDA Toolkit - Ubuntu - RuntimeError
RuntimeError: FlashAttention is only supported on CUDA 11.7 and above,原因是当前nvcc版本为11.5,不符合要求。解决方法如下:首先,从NVIDIA开发者网站下载并安装CUDA Toolkit 12.8版本,通过运行.run文件完成安装。安装后,配置环境变量。最后,通过nvcc --version验证安装。
2025-05-10 15:24:37
964
原创 Anaconda安装详解-Ubuntu 22.04-Linux(含华为昇腾)
下载Anaconda3最新版本,根据自己的操作系统选择适配的版本。按Enter或PgDn键滚动查看协议,然后输入yes同意。确认默认安装路径或自定义安装路径,按Enter。
2025-03-29 17:19:04
806
原创 已解决 TypeError: can only concatenate str (not “bytes“) to str
TypeError str bytes utf-8
2025-03-12 16:45:59
887
原创 已解决 IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
f(x)
2025-03-12 16:35:39
196
原创 OutOfMemoryError: CUDA out of memory--显存不足错误消息误读翻译校正
OutOfMemoryError: CUDA out of memory. 显示不足英文错误消息理解、翻译、校对或校正
2024-12-09 11:30:21
1450
1
原创 KeyError: “no style with name ‘List Bullet‘“ OR KeyError: “no style with name ‘Heading 1‘“
docx word python
2024-12-07 19:12:20
376
原创 Logging 日志输出 - 按天分割 - 无双重输出问题 - 可多个py文件 - 不适用多进程情况
Logging 多个py文件一个log文件,无双重输出。python。
2024-04-12 17:55:57
627
1
原创 TypeError: POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type s
python, 编码, 类别错误, typeerror
2024-01-06 09:48:48
561
原创 Rasa Multi-worker
1. $ conda activate myvirtualenv2. $ conda env config vars set ACTION_SERVER_SANIC_WORKERS=5To make your changes take effect please reactivate your environment3. $ conda env config vars set SANIC_WORKERS=5To make your changes take effect please reactiva
2023-12-05 16:58:47
395
原创 UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa1 in position 20: illegal multibyte sequence
Unicode
2021-12-23 14:46:24
762
原创 OR in Rasa Story(Rasa 故事中的 OR 问题)
OR:1. 目标:合并,重用Story的主体2.用法:除了OR两边的在特定对话状态下可能出现的意图外,其余部分均相同,从而通过OR在一个Story中实现两个会话:3.总结:好处是在使用时 OR无具体的数目限制;缺点如同Checkpoints,过度使用会在训练过程中引发内存问题。同时也可将其视为 NLU数据中某些意图可以进行合并的指标。...
2021-03-23 16:07:43
503
原创 Checkpoint in Rasa Story(Rasa 故事中的 Checkpoint 问题)
Checkpoint:1. 目标模块化,重用部分会话。2. 用法在要重用的部分会话的后边添加“>checkpoint_name”,例如:然后,就可以在其他 Story 中通过checkpoint_name(即“check_asked_question”)重用此部分会话:3. 问题使用 Checkpoint,虽然省事,但会很快导致严重的内存问题且可读性差,因而切记非万不得已勿用!...
2021-03-23 11:15:38
528
原创 UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xc3 in position 1895538: ordinal not in range(1
Failure:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1895538: ordinal not in range(128).Analyze:pip installed.Solution:From site-packages, find the related .py file, and replace 'ascii' with 'utf-8'.
2020-08-11 11:29:27
316
原创 PyTorch -- RuntimeError:
Failure:Concurrent:1.RuntimeError: Caught RuntimeError in replica 0 on device 0.2.RuntimeError: CUDA out of memory. Tried to allocate 12.00 MiB (GPU 0; 10.73 GiB total capacity; 1.36 GiB already allocated; 11.31 MiB free; 66.94 MiB cached)...
2020-05-29 19:48:00
2933
原创 PyTorch -- AssertionError:
Failure:AssertionError:The NVIDIA driver on your system is too old (found version 10010).Please update your GPU driver by downloading and installing a newversion from the URL: http://www.nvidia.com/Download/index.aspxAlternatively, go to: https://.
2020-05-29 19:11:49
2302
原创 NLTK -- LookupError: Resource punkt not found.
Failure:LookupError:********************************************************************** Resource punkt not found. Please use the NLTK Downloader to obtain the resource: >>> import nltk >>> nltk.download('punkt') Fo...
2020-05-29 19:03:35
1960
4
原创 机器翻译中的古汉语现代汉语句子对齐研究
第十一届全国机器翻译研讨会(CWMT 2015) 中国 · 合肥 2015.9.24-25汉语古现句子对齐研究李文句子对齐机器翻译摘要:古代汉语与现代汉语对齐方法,其中融入了新的特征,同时去掉了较常用的句长特征。通过句内
2017-11-20 18:18:43
2933
1
原创 DISK_ONLY 实现
于 pyspark (spark python) 中实现 DISK_ONLY:.persist(StorageLevel.DISK_ONLY)
2017-01-15 18:06:24
765
原创 Total size of serialized results of 20 tasks (1088.8 MB) is bigger than spark.driver.maxResultSize (
Total size of serialized results of 20 tasks (1088.8 MB) is bigger thanspark.driver.maxResultSize (1024.0 MB)pypark 2.0 (spark python) 执行中出现上述错误,解决方案:SparkContext.setSystemProperty('spark.driver.
2017-01-15 17:54:03
8984
转载 [转]python 如何在一个for循环中遍历两个列表
是我在看《笨方法学python》过程中发现有一行代码看不懂——“ for sentence in snippet, phrase:”,所以研究了半天,感觉挺有收获的。所以就放在博客上分享给大家了。直入主题:为了不耽误大家时间,如果知道以下为两段代码为什么输出不一样的话我觉得您肯定知道我下面要说的是什么了,您就不必花时间再读下去了。1和2两段代码的区别是print在for循环
2017-01-13 10:56:34
4207
转载 [转]Python MySQLdb在Linux下的快速安装
在家里windows环境下搞了一次见 python MySQLdb在windows环境下的快速安装、问题解决方式http://blog.youkuaiyun.com/wklken/article/details/7253245在公司开发需要,再搞一次,linux下的。发现用编译的方式安装真的很蛋疼,不过也算见见世面,各种问题......
2016-12-22 17:29:06
412
重复行删除程序 (Python 代码)
2016-02-18
重复行(或重复词语)删除程序 (Python 代码)
2016-06-03
基于条件随机场_CRFs_的中文词性标注方法
2016-02-18
有关词性标注的一点意见
2016-02-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅