add a new model for 'Laws' (#290)

### What problem does this PR solve?

Issue link:#289
### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
KevinHuSh 2024-04-10 11:59:00 +08:00 committed by GitHub
parent 923cbe488e
commit 243de6ac90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 8 deletions

View File

@ -172,8 +172,9 @@ $ docker compose up -d
## 🆕 Latest Features
- Support [Ollama](./docs/ollama.md) for local LLM deployment.
- Support Chinese UI.
- 2023-04-10 Add a new layout recognize model for method 'Laws'.
- 2023-04-08 Support [Ollama](./docs/ollama.md) for local LLM deployment.
- 2023-04-07 Support Chinese UI.
## 📜 Roadmap

View File

@ -171,9 +171,9 @@ $ docker compose up -d
```
## 🆕 最新の新機能
- [Ollama](./docs/ollama.md) を使用した大規模モデルのローカライズされたデプロイメントをサポートします。
- 中国語インターフェースをサポートします。
- 2023-04-10 メソッド「Laws」に新しいレイアウト認識モデルを追加します。
- 2023-04-08 [Ollama](./docs/ollama.md) を使用した大規模モデルのローカライズされたデプロイメントをサポートします。
- 2023-04-07 中国語インターフェースをサポートします。
## 📜 ロードマップ

View File

@ -172,8 +172,9 @@ $ docker compose up -d
## 🆕 最近新特性
- 支持用 [Ollama](./docs/ollama.md) 对大模型进行本地化部署。
- 支持中文界面。
- 2023-04-10 为Laws版面分析增加了模型。
- 2023-04-08 支持用 [Ollama](./docs/ollama.md) 对大模型进行本地化部署。
- 2023-04-07 支持中文界面。
## 📜 路线图

View File

@ -14,6 +14,8 @@ import copy
import re
from io import BytesIO
from docx import Document
from api.db import ParserType
from rag.nlp import bullets_category, is_english, tokenize, remove_contents_table, hierarchical_merge, \
make_colon_as_title, add_positions, tokenize_chunks
from rag.nlp import huqie
@ -23,7 +25,8 @@ from rag.settings import cron_logger
class Docx(DocxParser):
def __init__(self):
pass
self.model_speciess = ParserType.LAWS.value
super().__init__()
def __clean(self, line):
line = re.sub(r"\u3000", " ", line).strip()