Update README.md
Browse files
README.md
CHANGED
@@ -59,18 +59,20 @@ print(f"Tokens:\n\t{output.input_ids}")
|
|
59 |
print(f"Offsets: {offsets}")
|
60 |
```
|
61 |
|
62 |
-
This should result in the following (
|
63 |
|
64 |
-
|
65 |
-
Test string:
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
Tokens:
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
Offsets:
|
76 |
-
|
|
|
|
|
|
59 |
print(f"Offsets: {offsets}")
|
60 |
```
|
61 |
|
62 |
+
This should result in the following (_Feb '24 version_):
|
63 |
|
64 |
+
```python
|
65 |
+
>>> print(f"Test string: {test_string}")
|
66 |
+
Test string: When dealing with Varroa destructor mites, it's crucial to administer the right acaricides during the late autumn months, but only after ensuring that the worker bee population is free from pesticide contamination.
|
67 |
+
>>>
|
68 |
+
>>> # Tokens
|
69 |
+
>>> tokens = tokenizer.convert_ids_to_tokens(output['input_ids'])
|
70 |
+
>>> print(f"Tokens: {tokens}")
|
71 |
+
Tokens: ['When', '▁dealing', '▁with', '▁Varroa', '▁destructor', '▁mites,', "▁it's", '▁cru', 'cial', '▁to', '▁administer', '▁the', '▁right', '▁acar', 'icides', '▁during', '▁the', '▁late', '▁autumn', '▁months,', '▁but', '▁only', '▁after', '▁ensuring', '▁that', '▁the', '▁worker', '▁bee', '▁population', '▁is', '▁free', '▁from', '▁pesticide', '▁contam', 'ination.']
|
72 |
+
>>>
|
73 |
+
>>> # Offsets
|
74 |
+
>>> offsets = output['offset_mapping']
|
75 |
+
>>> print(f"Offsets: {offsets}")
|
76 |
+
Offsets: [(0, 4), (4, 12), (12, 17), (17, 24), (24, 35), (35, 42), (42, 47), (47, 51), (51, 55), (55, 58), (58, 69), (69, 73), (73, 79), (79, 84), (84, 90), (90, 97), (97, 101), (101, 106), (106, 113), (113, 121), (121, 125), (125, 130), (130, 136), (136, 145), (145, 150), (150, 154), (154, 161), (161, 165), (165, 176), (176, 179), (179, 184), (184, 189), (189, 199), (199, 206), (206, 214)]
|
77 |
+
```
|
78 |
+
|