Update README.md
Browse files
README.md
CHANGED
|
@@ -8,36 +8,39 @@ language: zh
|
|
| 8 |
|
| 9 |
## 介绍
|
| 10 |
* **[PaddlePaddle/uie-micro](https://huggingface.co/PaddlePaddle/uie-medium)** 的 Pytorch 实现
|
| 11 |
-
|
| 12 |
## 代码调用
|
| 13 |
|
| 14 |
### forward
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
|
| 30 |
### predict
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
| 41 |
|
| 42 |
```python
|
| 43 |
from tqdm import tqdm
|
|
|
|
| 8 |
|
| 9 |
## 介绍
|
| 10 |
* **[PaddlePaddle/uie-micro](https://huggingface.co/PaddlePaddle/uie-medium)** 的 Pytorch 实现
|
|
|
|
| 11 |
## 代码调用
|
| 12 |
|
| 13 |
### forward
|
| 14 |
+
#### *Parameters*
|
| 15 |
+
* `input_ids: Optional[torch.Tensor] = None`
|
| 16 |
+
* `token_type_ids: Optional[torch.Tensor] = None`
|
| 17 |
+
* `position_ids: Optional[torch.Tensor] = None`
|
| 18 |
+
* `attention_mask: Optional[torch.Tensor] = None`
|
| 19 |
+
* `head_mask: Optional[torch.Tensor] = None`
|
| 20 |
+
* `inputs_embeds: Optional[torch.Tensor] = None`
|
| 21 |
+
* `start_positions: Optional[torch.Tensor] = None`
|
| 22 |
+
* `end_positions: Optional[torch.Tensor] = None`
|
| 23 |
+
* `output_attentions: Optional[bool] = None`
|
| 24 |
+
* `output_hidden_states: Optional[bool] = None`
|
| 25 |
+
* `return_dict: Optional[bool] = None`
|
| 26 |
+
|
| 27 |
+
#### *Returns*
|
| 28 |
+
|
| 29 |
+
* `UIEModelOutput or tuple(torch.FloatTensor)`
|
| 30 |
|
| 31 |
### predict
|
| 32 |
+
#### *Parameters*
|
| 33 |
+
* `schema: Union[Dict, List[str], str]`
|
| 34 |
+
* `input_texts: Union[List[str], str]`
|
| 35 |
+
* `tokenizer: PreTrainedTokenizerFast`
|
| 36 |
+
* `max_length: int = 512`
|
| 37 |
+
* `batch_size: int = 32`
|
| 38 |
+
* `position_prob: int = 0.5`
|
| 39 |
+
* `progress_hook=None`
|
| 40 |
+
|
| 41 |
+
#### *Returns*
|
| 42 |
+
* `List[Dict]`
|
| 43 |
+
|
| 44 |
|
| 45 |
```python
|
| 46 |
from tqdm import tqdm
|