deeplotx 0.9.6__py3-none-any.whl → 0.9.7__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.
deeplotx/ner/bert_ner.py CHANGED
@@ -74,6 +74,8 @@ class BertNER(BaseNER):
74
74
  break
75
75
  for ent in entities:
76
76
  ent[0] = ent[0].strip()
77
+ if len(ent[0]) < 1:
78
+ ent[0] = ' '
77
79
  # stripping
78
80
  while not ent[0][0].isalpha():
79
81
  if len(ent[0]) < 2:
@@ -13,6 +13,17 @@ def read_file(path: str, encoding: str = 'utf-8') -> str:
13
13
  pass
14
14
 
15
15
 
16
+ def write_file(content: str | bytes, path: str, encoding: str = 'utf-8') -> str:
17
+ os.makedirs(os.path.dirname(path), exist_ok=True)
18
+ if isinstance(content, bytes):
19
+ with open(path, mode='wb') as f:
20
+ f.write(content)
21
+ return path
22
+ with open(path, mode='w', encoding=encoding) as f:
23
+ f.write(content)
24
+ return path
25
+
26
+
16
27
  def get_files(path: str) -> list:
17
28
  if os.path.exists(path):
18
29
  entries = os.listdir(path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deeplotx
3
- Version: 0.9.6
3
+ Version: 0.9.7
4
4
  Summary: An out-of-the-box long-text NLP framework.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -5,7 +5,7 @@ deeplotx/encoder/long_text_encoder.py,sha256=4oRa9FqfGNZ8-gq14UKuhDkZC0A1Xi-wKmb
5
5
  deeplotx/encoder/longformer_encoder.py,sha256=7Lm65AUD3qwbrzrhJ3dPZkyHeNRSapga3f-5QJCxV5A,3538
6
6
  deeplotx/ner/__init__.py,sha256=Rss1pup9HzHZCG8U9ub8niWa9zRjWCy3Z7zg378KZQg,114
7
7
  deeplotx/ner/base_ner.py,sha256=pZTl50OrHH_FJm4rKp9iuixeOE6FX_AzgDXD32aXsN0,204
8
- deeplotx/ner/bert_ner.py,sha256=_IpR2AqXzEP_QBUj8KKVS7jO9mHZyFGDxr7q1LUgJf4,9246
8
+ deeplotx/ner/bert_ner.py,sha256=xTePPaf-EI-m3Sx6u9fJrEHxix5-To2YWiatcAEimGA,9309
9
9
  deeplotx/ner/named_entity.py,sha256=c6XufIwH6yloJ-ccUjagf4mBl1XbbYDT8xyEJJ_-ZNs,269
10
10
  deeplotx/ner/n2g/__init__.py,sha256=b6fOWJVLaOCtoz8Qlp8NWQbL5lUSbn6H3-8fnVNIPi0,3940
11
11
  deeplotx/nn/__init__.py,sha256=YILwbxb-NHdiJjfOwBKH8F7PuZSDZSrGpTznPDucTro,710
@@ -32,9 +32,9 @@ deeplotx/trainer/base_trainer.py,sha256=z0MeAT-rRYmjeBXt0ckt7J1itYArR0Cx02wHesXU
32
32
  deeplotx/trainer/text_binary_classification_trainer.py,sha256=TFxOX8rWU_zKliI9zm7F5ZH7snR2d-sk95s3pfTmm78,6601
33
33
  deeplotx/util/__init__.py,sha256=5CH4MTeSgsmCe3LPMfvKoSBpwh6jDSBuHVElJvzQzgs,90
34
34
  deeplotx/util/hash.py,sha256=qbNU3RLBWGQYFVte9WZBAkZ1BkdjCXiKLDaKPN54KFk,662
35
- deeplotx/util/read_file.py,sha256=ptzouvEQeeW8KU5BrWNJlXw-vFXVrpS9SkAUxsu6A8A,612
36
- deeplotx-0.9.6.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
37
- deeplotx-0.9.6.dist-info/METADATA,sha256=yjG3QmoZfUJwenoR76b7MXAjzCt7Qh9UMr1CishZFG4,14442
38
- deeplotx-0.9.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
- deeplotx-0.9.6.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
40
- deeplotx-0.9.6.dist-info/RECORD,,
35
+ deeplotx/util/read_file.py,sha256=O9nieNgAGQ7Ct1EFxCdcgL6hVs5s2Vw_ItcUK6VeTwY,981
36
+ deeplotx-0.9.7.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
37
+ deeplotx-0.9.7.dist-info/METADATA,sha256=Q-3dVHeAaVuh6yN0cJTY4axk8jRFd2vkHqsbMa0jPoA,14442
38
+ deeplotx-0.9.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
+ deeplotx-0.9.7.dist-info/top_level.txt,sha256=hKg4pVDXZ-WWxkRfJFczRIll1Sv7VyfKCmzHLXbuh1U,9
40
+ deeplotx-0.9.7.dist-info/RECORD,,