Update README indentation and space
Browse files
README.md
CHANGED
|
@@ -34,6 +34,7 @@ Note that this model is primiarly aimed at predicting whether a Classical Chines
|
|
| 34 |
Note that this model is primiarly aimed at predicting whether a Classical Chinese sentence is a letter title (书信标题) or not.
|
| 35 |
|
| 36 |
Here is how to use this model to get the features of a given text in PyTorch:
|
|
|
|
| 37 |
1. Import model
|
| 38 |
```python
|
| 39 |
from transformers import BertTokenizer
|
|
@@ -93,8 +94,8 @@ print(f'The predicted probability for the {list(pred_class_proba.keys())[0]} cla
|
|
| 93 |
print(f'The predicted probability for the {list(pred_class_proba.keys())[1]} class: {list(pred_class_proba.values())[1]}')
|
| 94 |
>>> The predicted probability for the not-letter class: 0.002029061783105135
|
| 95 |
>>> The predicted probability for the letter class: 0.9979709386825562
|
| 96 |
-
pred_class = idx2label[np.argmax(list(pred_class_proba.values()))]
|
| 97 |
|
|
|
|
| 98 |
print(f'The predicted class is: {pred_class}')
|
| 99 |
>>> The predicted class is: letter
|
| 100 |
```
|
|
|
|
| 34 |
Note that this model is primiarly aimed at predicting whether a Classical Chinese sentence is a letter title (书信标题) or not.
|
| 35 |
|
| 36 |
Here is how to use this model to get the features of a given text in PyTorch:
|
| 37 |
+
|
| 38 |
1. Import model
|
| 39 |
```python
|
| 40 |
from transformers import BertTokenizer
|
|
|
|
| 94 |
print(f'The predicted probability for the {list(pred_class_proba.keys())[1]} class: {list(pred_class_proba.values())[1]}')
|
| 95 |
>>> The predicted probability for the not-letter class: 0.002029061783105135
|
| 96 |
>>> The predicted probability for the letter class: 0.9979709386825562
|
|
|
|
| 97 |
|
| 98 |
+
pred_class = idx2label[np.argmax(list(pred_class_proba.values()))]
|
| 99 |
print(f'The predicted class is: {pred_class}')
|
| 100 |
>>> The predicted class is: letter
|
| 101 |
```
|