Skip to content

Commit 171dd6a

Browse files
author
gulaoer123
committed
first
0 parents  commit 171dd6a

49 files changed

Lines changed: 15558 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.DS_Store

6 KB
Binary file not shown.

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/project1-text-cls.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# 训练模型
2+
3+
```commandline
4+
python3 training_code/train_tfidf.py
5+
python3 training_code/train_bert.py
6+
```
7+
8+
# 压测服务
9+
10+
```commandline
11+
cd test/
12+
13+
ab -n 100 -c 100 -p data.json -T 'application/json' -H 'accept: application/json' 'http://0.0.0.0:8000/v1/text-cls/regex'
14+
ab -n 100 -c 100 -p data.json -T 'application/json' -H 'accept: application/json' 'http://0.0.0.0:8000/v1/text-cls/tfidf'
15+
ab -n 100 -c 100 -p data.json -T 'application/json' -H 'accept: application/json' 'http://0.0.0.0:8000/v1/text-cls/bert'
16+
```
17+
18+
# 接口
19+
20+
```commandline
21+
curl -X 'POST' \
22+
'http://0.0.0.0:8000/v1/text-cls/tfidf' \
23+
-H 'accept: application/json' \
24+
-H 'Content-Type: application/json' \
25+
-d '{
26+
"request_id": "string",
27+
"request_text": "帮我播放周杰伦的歌曲"
28+
}'
29+
```
30+
31+
# 部署
32+
33+
```commandline
34+
fastapi run main.py
35+
```
36+
37+
# 推广
38+
```commandline
39+
可以重新找一个公开数据集(比如在魔搭社区的数据集),或直接标注一个文本分类数据集(推荐3个以上的类别个数),复现加载bert base 模型在新数据集上的微调过程。最终输入一个新的样本进行测试,验证分类效果是否准确。
40+
```

__pycache__/config.cpython-310.pyc

752 Bytes
Binary file not shown.

__pycache__/config.cpython-312.pyc

801 Bytes
Binary file not shown.

__pycache__/config.cpython-39.pyc

773 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)