| import re |
| import py_vncorenlp |
| from const import * |
| from pprint import pprint |
| from latex2operatortree import * |
| from transformers import AutoTokenizer, AutoModel |
| from const import LATEX_VOC |
| |
| |
|
|
| |
|
|
| |
| |
| |
| |
|
|
|
|
| model_path = "huuminh365/CustomBERT" |
| latex_token = LATEX_VOC |
| |
|
|
| tok = AutoTokenizer.from_pretrained(model_path) |
| |
|
|
| tok.add_tokens(latex_token) |
| |
| text = 'Tính diện tích hình phẳng giới hạn bởi đồ thị các hàm số $y =x^3$, $y=x^5$, $\dfrac{2}{x}=5$. Cho hàm số $y=f(x)$ liên tục trên $\mathbb{R}$, có đồ thị cắt trục $Ox$ tại các điểm có hoành độ' |
| print(tok.tokenize(text)) |