Skip to content

Commit c129214

Browse files
committed
update readme
1 parent 9543f5d commit c129214

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,22 @@ segmenter.segment('I am Batman i live in gotham')
4141
# ['I am Batman', 'i live in gotham']
4242
```
4343

44+
# Finetuning DeepSegment
45+
```python
46+
from deepsegment import finetune, generate_data
47+
48+
x, y = generate_data(['my name', 'is batman', 'who are', 'you'], n_examples=10000)
49+
vx, vy = generate_data(['my name', 'is batman'])
50+
51+
# NOTE: name, epochs, batch_size, lr are optional arguments.
52+
finetune('en', x, y, vx, vy, name='finetuned_model_name', epochs=number_of_epochs, batch_size=batch_size, lr=learning_rate)
53+
```
54+
55+
# Using with a finetuned checkpoint
56+
```python
57+
from deepsegment import DeepSegment
58+
segmenter = DeepSegment('en', checkpoint_name='finetuned_model_name')
59+
```
60+
61+
4462
Training deepsegment on custom data: https://colab.research.google.com/drive/1CjYbdbDHX1UmIyvn7nDW2ClQPnnNeA_m

0 commit comments

Comments
 (0)