python - 使用 Python 计算给定句子中的 T 单元数
问题描述
我一直在从事第二语言开发项目。我需要使用 Python 计算给定句子的t 单位。例如,对于以下句子:
The man did not like water.
1 t-单位(这个人不喜欢水)
The man did not like water although he lived by the sea.
1 t-unit(这个人虽然住在海边,但不喜欢水)
The man never liked water and he certainly did not like living in the swamp with her grandparents.
1 t-unit(这个男人从不喜欢水) 1 t-unit(他当然不喜欢和她的祖父母一起住在沼泽里)
The man did not like water or juice.
1 吨单位(该男子不喜欢水或果汁)
我检查了 nltk、spacy 和 stanford nlp (stanza),但发现它们根本不包括这样的 t-unit 检测。
我遇到过这个,但它是关于子句提取的。
知道如何使用 Python 检测这样的 t 单元吗?
解决方案
推荐阅读
- sql-server-2008 - 如何根据sql server中的多个条件获取位置
- groovy - 分支的 Bitbucket 条件限制
- python - 在 Python dict 的键中使用连字符
- python - Dask 存储/读取不适合内存的稀疏矩阵
- python - python 帮助 - 语法错误:行继续字符后出现意外字符
- swift - 更改折线颜色 Swift Xcode
- c# - 从动态列表调用扩展方法
- html - IE11 中图像的 CSS 问题中心和“最大宽度”
- reactjs - React useState - setValue 重新渲染组件,即使值相同
- android - 在坐标系原点将图像旋转 90°