deeplotx 0.0.0__py3-none-any.whl → 0.2.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deeplot → deeplotx}/__init__.py +3 -3
- {deeplot → deeplotx}/encoder/bert_encoder.py +1 -1
- {deeplot → deeplotx}/encoder/long_text_encoder.py +3 -3
- {deeplot → deeplotx}/nn/base_neural_network.py +2 -2
- {deeplot → deeplotx}/nn/linear_regression.py +1 -1
- {deeplot → deeplotx}/nn/logistic_regression.py +1 -1
- {deeplot → deeplotx}/nn/softmax_regression.py +1 -1
- {deeplot → deeplotx}/trainer/base_trainer.py +1 -1
- {deeplot → deeplotx}/trainer/text_binary_classification_trainer.py +4 -4
- {deeplotx-0.0.0.dist-info → deeplotx-0.2.17.dist-info}/METADATA +12 -12
- deeplotx-0.2.17.dist-info/RECORD +20 -0
- deeplotx-0.2.17.dist-info/top_level.txt +1 -0
- deeplotx-0.0.0.dist-info/RECORD +0 -20
- deeplotx-0.0.0.dist-info/top_level.txt +0 -1
- {deeplot → deeplotx}/encoder/__init__.py +0 -0
- {deeplot → deeplotx}/nn/__init__.py +0 -0
- {deeplot → deeplotx}/trainer/__init__.py +0 -0
- {deeplot → deeplotx}/util/__init__.py +0 -0
- {deeplot → deeplotx}/util/hash.py +0 -0
- {deeplot → deeplotx}/util/read_file.py +0 -0
- {deeplotx-0.0.0.dist-info → deeplotx-0.2.17.dist-info}/WHEEL +0 -0
- {deeplotx-0.0.0.dist-info → deeplotx-0.2.17.dist-info}/licenses/LICENSE +0 -0
{deeplot → deeplotx}/__init__.py
RENAMED
@@ -12,7 +12,7 @@ __EMAIL__ = 'vortez.wohl@gmail.com'
|
|
12
12
|
__GITHUB__ = 'https://github.com/vortezwohl'
|
13
13
|
__BLOG__ = 'https://vortezwohl.github.io'
|
14
14
|
|
15
|
-
logger = logging.getLogger('
|
15
|
+
logger = logging.getLogger('deeplotx')
|
16
16
|
logger.setLevel(logging.DEBUG)
|
17
17
|
|
18
18
|
formatter = logging.Formatter('[%(levelname)s] %(asctime)s %(name)s : %(message)s')
|
@@ -22,7 +22,7 @@ console_handler.setLevel(logging.DEBUG)
|
|
22
22
|
console_handler.setFormatter(formatter)
|
23
23
|
logger.addHandler(console_handler)
|
24
24
|
|
25
|
-
logger = logging.getLogger('
|
25
|
+
logger = logging.getLogger('deeplotx.trainer')
|
26
26
|
logger.setLevel(logging.DEBUG)
|
27
|
-
logger = logging.getLogger('
|
27
|
+
logger = logging.getLogger('deeplotx.embedding')
|
28
28
|
logger.setLevel(logging.DEBUG)
|
@@ -5,10 +5,10 @@ from typing_extensions import override
|
|
5
5
|
|
6
6
|
import torch
|
7
7
|
|
8
|
-
from
|
9
|
-
from
|
8
|
+
from deeplotx.encoder.bert_encoder import BertEncoder, DEFAULT_BERT
|
9
|
+
from deeplotx.util.hash import md5
|
10
10
|
|
11
|
-
logger = logging.getLogger('
|
11
|
+
logger = logging.getLogger('deeplotx.embedding')
|
12
12
|
|
13
13
|
|
14
14
|
class LongTextEncoder(BertEncoder):
|
@@ -40,9 +40,9 @@ class BaseNeuralNetwork(nn.Module):
|
|
40
40
|
return res
|
41
41
|
|
42
42
|
def save(self):
|
43
|
-
torch.save(self.state_dict(), f'{self._model_name}.
|
43
|
+
torch.save(self.state_dict(), f'{self._model_name}.deeplotx.pth')
|
44
44
|
return self
|
45
45
|
|
46
46
|
def load(self):
|
47
|
-
self.load_state_dict(torch.load(f'{self._model_name}.
|
47
|
+
self.load_state_dict(torch.load(f'{self._model_name}.deeplotx.pth'))
|
48
48
|
return self
|
@@ -5,11 +5,11 @@ import torch
|
|
5
5
|
from torch import nn, optim
|
6
6
|
from torch.utils.data import DataLoader, TensorDataset
|
7
7
|
|
8
|
-
from
|
9
|
-
from
|
10
|
-
from
|
8
|
+
from deeplotx.encoder.long_text_encoder import LongTextEncoder
|
9
|
+
from deeplotx.nn.logistic_regression import LogisticRegression
|
10
|
+
from deeplotx.trainer.base_trainer import BaseTrainer
|
11
11
|
|
12
|
-
logger = logging.getLogger('
|
12
|
+
logger = logging.getLogger('deeplotx.trainer')
|
13
13
|
|
14
14
|
|
15
15
|
class TextBinaryClassifierTrainer(BaseTrainer):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: deeplotx
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.17
|
4
4
|
Summary: Easy-2-use long text classifier trainers.
|
5
5
|
Requires-Python: >=3.10
|
6
6
|
Description-Content-Type: text/markdown
|
@@ -14,20 +14,20 @@ Requires-Dist: transformers>=4.51.3
|
|
14
14
|
Requires-Dist: typing-extensions>=4.13.2
|
15
15
|
Dynamic: license-file
|
16
16
|
|
17
|
-
#
|
17
|
+
# DeepLoTX: Easy2UseLongTextClassifierTrainers
|
18
18
|
|
19
19
|
## Installation
|
20
20
|
|
21
21
|
- Install with pip
|
22
22
|
|
23
23
|
```
|
24
|
-
pip install git+https://github.com/vortezwohl/
|
24
|
+
pip install git+https://github.com/vortezwohl/DeepLoTX.git
|
25
25
|
```
|
26
26
|
|
27
27
|
- Install with uv
|
28
28
|
|
29
29
|
```
|
30
|
-
uv add git+https://github.com/vortezwohl/
|
30
|
+
uv add git+https://github.com/vortezwohl/DeepLoTX.git
|
31
31
|
```
|
32
32
|
|
33
33
|
## Quick Start
|
@@ -35,19 +35,19 @@ Dynamic: license-file
|
|
35
35
|
To train a binary classifier for text files:
|
36
36
|
|
37
37
|
```python
|
38
|
-
from
|
39
|
-
from
|
38
|
+
from deeplotx.util import get_files, read_file
|
39
|
+
from deeplotx import TextBinaryClassifierTrainer, LongTextEncoder
|
40
40
|
|
41
41
|
long_text_encoder = LongTextEncoder(
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
max_length=2048,
|
43
|
+
chunk_size=512,
|
44
|
+
overlapping=128
|
45
45
|
)
|
46
46
|
|
47
47
|
trainer = TextBinaryClassifierTrainer(
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
long_text_encoder=long_text_encoder,
|
49
|
+
batch_size=4,
|
50
|
+
train_ratio=0.9
|
51
51
|
)
|
52
52
|
|
53
53
|
pos_data_path = './data/pos'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
deeplotx/__init__.py,sha256=Bhxc6HRnuhPZCMNlBc6oKcFTpJbWRGrZmt00vVOsNf0,916
|
2
|
+
deeplotx/encoder/__init__.py,sha256=x7k8IE0FXvDl7kCJGWPsetOHFdvNCiCXHbYOdvo7_JQ,87
|
3
|
+
deeplotx/encoder/bert_encoder.py,sha256=rdT8YgZzvRoqYqtzPW95ilagSQTAQgUl7mMVetGKxCY,1822
|
4
|
+
deeplotx/encoder/long_text_encoder.py,sha256=yEEtTVZYHJ0W3OSbh7BHm6xI33nJmVYlSrgD5RVcJLY,2967
|
5
|
+
deeplotx/nn/__init__.py,sha256=9gh8rhKqVWtJyvryU_wHPTLEQIorwOBhAQRc0DtNamM,153
|
6
|
+
deeplotx/nn/base_neural_network.py,sha256=UzslQwxuQ1KKker4EMrymSnZbHsfv2m6o7lB2cpnRq4,1665
|
7
|
+
deeplotx/nn/linear_regression.py,sha256=D4mEWVOq6q1Fm2otm57rgZ_E06HJLZBV5k636PprAf4,1520
|
8
|
+
deeplotx/nn/logistic_regression.py,sha256=QAtZp2oyqOW8-1pJWVcahsSM83bzfA68EHObg-wSHHY,463
|
9
|
+
deeplotx/nn/softmax_regression.py,sha256=eUn3mVNlye9ewVdw3McPHZuKbUvvaamsUgFIJMVMgBU,487
|
10
|
+
deeplotx/trainer/__init__.py,sha256=Fl5DR9UecQc5VtBcczU9sx_HtPNoFohpuELOh-Jrsks,77
|
11
|
+
deeplotx/trainer/base_trainer.py,sha256=z0MeAT-rRYmjeBXt0ckt7J1itYArR0Cx02wHesXUoZE,385
|
12
|
+
deeplotx/trainer/text_binary_classification_trainer.py,sha256=SEisKhDhcOoV87N0xLLVwuZrDSadcHmdoFIji-RqjT4,4375
|
13
|
+
deeplotx/util/__init__.py,sha256=JxqAK_WOOHcYVSTHBT1-WuBwWrPEVDTV3titeVWvNUM,74
|
14
|
+
deeplotx/util/hash.py,sha256=wwsC6kOQvbpuvwKsNQOARd78_wePmW9i3oaUuXRUnpc,352
|
15
|
+
deeplotx/util/read_file.py,sha256=ptzouvEQeeW8KU5BrWNJlXw-vFXVrpS9SkAUxsu6A8A,612
|
16
|
+
deeplotx-0.2.17.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
17
|
+
deeplotx-0.2.17.dist-info/METADATA,sha256=vLT0JEIABm8g2FPaXgYSKve8ikucXUqN_6-wIJljKFw,1573
|
18
|
+
deeplotx-0.2.17.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
19
|
+
deeplotx-0.2.17.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
|
20
|
+
deeplotx-0.2.17.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
deeplotx
|
deeplotx-0.0.0.dist-info/RECORD
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
deeplot/__init__.py,sha256=P00awNec4YbQnpFR8SHmOG2Ud3fTrf5P8zQM9-KSUMI,913
|
2
|
-
deeplot/encoder/__init__.py,sha256=x7k8IE0FXvDl7kCJGWPsetOHFdvNCiCXHbYOdvo7_JQ,87
|
3
|
-
deeplot/encoder/bert_encoder.py,sha256=MVA4BV9d-jUg-54g4XO2ifvEwjd0hbgUJUuwKhkCFAU,1821
|
4
|
-
deeplot/encoder/long_text_encoder.py,sha256=CMsjLsusORK95BmPwOD99Rtt9_rJl8N2GvxUhXlH08I,2964
|
5
|
-
deeplot/nn/__init__.py,sha256=9gh8rhKqVWtJyvryU_wHPTLEQIorwOBhAQRc0DtNamM,153
|
6
|
-
deeplot/nn/base_neural_network.py,sha256=JEQdCjPKbhI6VW8QfGMNZq1fwy9KOxk2BffCew9fWMw,1663
|
7
|
-
deeplot/nn/linear_regression.py,sha256=Thm-d-1i7YMp4Gyq2RQ62VHH-92KWgx7pho1azxq-Tg,1519
|
8
|
-
deeplot/nn/logistic_regression.py,sha256=I6WCoC24T2AjnwtHpNDzQUL21jO4Of_KgSVdnEiRHOQ,462
|
9
|
-
deeplot/nn/softmax_regression.py,sha256=rP5n2z18n6c8iNST0cwcQz-CnN6BkDVHBcuU3A55BNA,486
|
10
|
-
deeplot/trainer/__init__.py,sha256=Fl5DR9UecQc5VtBcczU9sx_HtPNoFohpuELOh-Jrsks,77
|
11
|
-
deeplot/trainer/base_trainer.py,sha256=m7lCdBXhDelYJjEXZR2p2DbHMgx2fr3v0dm-RwVR3QU,384
|
12
|
-
deeplot/trainer/text_binary_classification_trainer.py,sha256=6ZzfRVfX2Iy84vppaR91oXghF8IpbVi_0UtTcO4njg4,4371
|
13
|
-
deeplot/util/__init__.py,sha256=JxqAK_WOOHcYVSTHBT1-WuBwWrPEVDTV3titeVWvNUM,74
|
14
|
-
deeplot/util/hash.py,sha256=wwsC6kOQvbpuvwKsNQOARd78_wePmW9i3oaUuXRUnpc,352
|
15
|
-
deeplot/util/read_file.py,sha256=ptzouvEQeeW8KU5BrWNJlXw-vFXVrpS9SkAUxsu6A8A,612
|
16
|
-
deeplotx-0.0.0.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
|
17
|
-
deeplotx-0.0.0.dist-info/METADATA,sha256=v48ux4KDXevbOMVgLptS6k6d7-rwLNZ3_K5rE8Yikuo,1579
|
18
|
-
deeplotx-0.0.0.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
19
|
-
deeplotx-0.0.0.dist-info/top_level.txt,sha256=AlFZhoW4SUpa3Y7D0IEWeH8PNLJfyXb-Xekk7M-z_fI,8
|
20
|
-
deeplotx-0.0.0.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
deeplot
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|