hankcs / hankcs/HanLP

amr解析部分数字出错

Open
#1,721 4 comments 0 reactions 1 assignee Claimed by @hankcs View on GitHub
bug
Dominant language
Python
Stars
36.5k
Forks
10.9k
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
例1:我给了他15万元。
amr 解析结果如下图:
![bug](https://user-images.githubusercontent.com/10105704/163555082-0d6052d6-20c6-4a75-be86-26dc3a2035a3.png)
“**15万**” 未被正确解析

---
例2: 我给了他十五点八万元。
![bug2](https://user-images.githubusercontent.com/10105704/163556640-02c5c566-6d1a-401b-b102-c2982947f36f.png)

“**十五点八万**” 未被正确解析

---
例3: 我给了他十元三角八分钱。
![屏幕快照 2022-04-15 下午5 54 34](https://user-images.githubusercontent.com/10105704/163557085-a1f0bb31-15d9-43cf-8af9-430a8dae10f8.png)
“**十元三角八分**” 未被正确解析

**Code to reproduce the issue**
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

```python
```

**Describe the current behavior**
**将“15万”改为“十五万”后,可解析为 “150000”**
错误应出自数字转换的过程。 可以参考 https://github.com/microsoft/Recognizers-Text

**Expected behavior**
能正确显示 label。
当然了,输出数据里的 anchors 标记了原文位置,所以问题也不是特别的大😄

看了下输出的数据,anchors是保留了原文的位置,所以问题也不是特别的大。

**System information**
- OS Platform and Distribution (Linux Ubuntu 16.04):
- Python version: 3.9
- HanLP version: 2.1b23

**Other info / logs**
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

* [x] I've completed this form and searched the web for solutions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.