deeplotx 0.0.0__py3-none-any.whl → 0.2.18__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.
@@ -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('deeplot')
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('deeplot.trainer')
25
+ logger = logging.getLogger('deeplotx.trainer')
26
26
  logger.setLevel(logging.DEBUG)
27
- logger = logging.getLogger('deeplot.embedding')
27
+ logger = logging.getLogger('deeplotx.embedding')
28
28
  logger.setLevel(logging.DEBUG)
@@ -3,7 +3,7 @@ import torch
3
3
  from torch import nn
4
4
  from transformers import BertTokenizer, BertModel
5
5
 
6
- from deeplot import __ROOT__
6
+ from deeplotx import __ROOT__
7
7
 
8
8
  CACHE_PATH = f'{__ROOT__}\\.cache'
9
9
  DEFAULT_BERT = 'bert-base-uncased'
@@ -5,10 +5,10 @@ from typing_extensions import override
5
5
 
6
6
  import torch
7
7
 
8
- from deeplot.encoder.bert_encoder import BertEncoder, DEFAULT_BERT
9
- from deeplot.util.hash import md5
8
+ from deeplotx.encoder.bert_encoder import BertEncoder, DEFAULT_BERT
9
+ from deeplotx.util.hash import md5
10
10
 
11
- logger = logging.getLogger('deeplot.embedding')
11
+ logger = logging.getLogger('deeplotx.embedding')
12
12
 
13
13
 
14
14
  class LongTextEncoder(BertEncoder):
@@ -25,9 +25,8 @@ class BaseNeuralNetwork(nn.Module):
25
25
  return l2_reg
26
26
  return _lambda * _l2()
27
27
 
28
- def elastic_net(self, alpha: float = 1e-4, rho: float = 0.5,
29
- lambda_l1: float = 1e-4, lambda_l2: float = 1e-4) -> torch.Tensor:
30
- return alpha * rho * self.l1(_lambda=lambda_l1) + alpha * (1 - rho) * self.l2(_lambda=lambda_l2) / 2.
28
+ def elastic_net(self, alpha: float = 1e-4, rho: float = 0.5) -> torch.Tensor:
29
+ return alpha * rho * self.l1(_lambda=1.) + alpha * (1 - rho) * self.l2(_lambda=1.) / 2.
31
30
 
32
31
  def forward(self, x) -> torch.Tensor: ...
33
32
 
@@ -40,9 +39,9 @@ class BaseNeuralNetwork(nn.Module):
40
39
  return res
41
40
 
42
41
  def save(self):
43
- torch.save(self.state_dict(), f'{self._model_name}.deeplot.pth')
42
+ torch.save(self.state_dict(), f'{self._model_name}.deeplotx.pth')
44
43
  return self
45
44
 
46
45
  def load(self):
47
- self.load_state_dict(torch.load(f'{self._model_name}.deeplot.pth'))
46
+ self.load_state_dict(torch.load(f'{self._model_name}.deeplotx.pth'))
48
47
  return self
@@ -3,7 +3,7 @@ from typing_extensions import override
3
3
  import torch
4
4
  from torch import nn
5
5
 
6
- from deeplot.nn.base_neural_network import BaseNeuralNetwork
6
+ from deeplotx.nn.base_neural_network import BaseNeuralNetwork
7
7
 
8
8
 
9
9
  class LinearRegression(BaseNeuralNetwork):
@@ -2,7 +2,7 @@ from typing_extensions import override
2
2
 
3
3
  import torch
4
4
 
5
- from deeplot.nn.linear_regression import LinearRegression
5
+ from deeplotx.nn.linear_regression import LinearRegression
6
6
 
7
7
 
8
8
  class LogisticRegression(LinearRegression):
@@ -2,7 +2,7 @@ from typing_extensions import override
2
2
 
3
3
  import torch
4
4
 
5
- from deeplot.nn.linear_regression import LinearRegression
5
+ from deeplotx.nn.linear_regression import LinearRegression
6
6
 
7
7
 
8
8
  class SoftmaxRegression(LinearRegression):
@@ -1,6 +1,6 @@
1
1
  from abc import abstractmethod
2
2
 
3
- from deeplot.nn.base_neural_network import BaseNeuralNetwork
3
+ from deeplotx.nn.base_neural_network import BaseNeuralNetwork
4
4
 
5
5
 
6
6
  class BaseTrainer(object):
@@ -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 deeplot.encoder.long_text_encoder import LongTextEncoder
9
- from deeplot.nn.logistic_regression import LogisticRegression
10
- from deeplot.trainer.base_trainer import BaseTrainer
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('deeplot.trainer')
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.0.0
3
+ Version: 0.2.18
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
- # DeepLoT: Easy2UseLongTextClassifierTrainers
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/DeepLoT.git
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/DeepLoT.git
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 deeplot.util import get_files, read_file
39
- from deeplot import TextBinaryClassifierTrainer, LongTextEncoder
38
+ from deeplotx.util import get_files, read_file
39
+ from deeplotx import TextBinaryClassifierTrainer, LongTextEncoder
40
40
 
41
41
  long_text_encoder = LongTextEncoder(
42
- max_length=2048,
43
- chunk_size=512,
44
- overlapping=128
42
+ max_length=2048,
43
+ chunk_size=512,
44
+ overlapping=128
45
45
  )
46
46
 
47
47
  trainer = TextBinaryClassifierTrainer(
48
- long_text_encoder=long_text_encoder,
49
- batch_size=4,
50
- train_ratio=0.9
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=EjBqW_8DMNX9TqNzOaLsLi5RzgsCyBaCgwuVque4jwk,1580
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.18.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
17
+ deeplotx-0.2.18.dist-info/METADATA,sha256=fn9tKJrvY8_JnnnpMG4N6EajaTI3HgN2iRrFodc5SE0,1573
18
+ deeplotx-0.2.18.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
19
+ deeplotx-0.2.18.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
20
+ deeplotx-0.2.18.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ deeplotx
@@ -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