File tree 10 files changed +45
-25
lines changed
auto_install/health_checks
10 files changed +45
-25
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,24 @@ sidebar:
16
16
See [ Github Releases] ( https://github.com/JohnSnowLabs/johnsnowlabs/releases ) for detailed information on Release History and Features
17
17
18
18
19
+ ## 6.0.0
20
+ Release date: 5-4-2025
21
+
22
+ The John Snow Labs 6.0.0 Library released with the following pre-installed and recommended dependencies
23
+
24
+ {:.table-model-big}
25
+ | Library | Version |
26
+ | -----------------------------------------------------------------------------------------| ------------|
27
+ | [ Visual NLP] ( https://nlp.johnsnowlabs.com/docs/en/spark_ocr_versions/ocr_release_notes ) | ` 6.0.0 ` |
28
+ | [ Enterprise NLP] ( https://nlp.johnsnowlabs.com/docs/en/licensed_annotators ) | ` 6.0.0 ` |
29
+ | [ Finance NLP] ( https://nlp.johnsnowlabs.com/docs/en/financial_release_notes ) | ` 1.X.X ` |
30
+ | [ Legal NLP] ( https://nlp.johnsnowlabs.com/docs/en/legal_release_notes ) | ` 1.X.X ` |
31
+ | [ NLU] ( https://github.com/JohnSnowLabs/nlu/releases ) | ` 5.4.1 ` |
32
+ | [ Spark-NLP-Display] ( https://sparknlp.org/docs/en/display ) | ` 5.0 ` |
33
+ | [ Spark-NLP] ( https://github.com/JohnSnowLabs/spark-nlp/releases/ ) | ` 6.0.0 ` |
34
+ | [ Pyspark] ( https://spark.apache.org/docs/latest/api/python/ ) | ` 3.4.0 ` |
35
+
36
+
19
37
20
38
## 5.5.5
21
39
Release date: 3-14-2025
Original file line number Diff line number Diff line change 3
3
from abc import ABC
4
4
from typing import List , Set , Optional
5
5
6
- import pkg_resources
6
+ from importlib . metadata import version
7
7
8
8
from johnsnowlabs import settings
9
9
from johnsnowlabs .abstract_base .lib_resolver import Py4JJslLibDependencyResolverABC
@@ -93,17 +93,10 @@ def check_installed_correct_version(
93
93
):
94
94
return False
95
95
try :
96
- if (
97
- pkg_resources .get_distribution (cls .pypi_name ).version
98
- == cls .latest_version .as_str ()
99
- ):
96
+ if version (cls .pypi_name ) == cls .latest_version .as_str ():
100
97
# print(f'👌 Installed version for {cls.logo + cls.name} is correct, no changes made.')
101
98
return True
102
99
else :
103
- # print(f'🤓 Installed version for {cls.logo + cls.name} is incorrect, '
104
- # f'should be {cls.latest_version.as_str()} but is {pkg_resources.get_distribution(cls.pypi_name).version} '
105
- # f'upgrading the package')
106
-
107
100
return False
108
101
except Exception as err :
109
102
v = get_pip_lib_version (lib = cls .pypi_name , py_exec = python_exec_path )
@@ -118,11 +111,11 @@ def get_installed_version(
118
111
download_folder : str = None ,
119
112
prefer_pip = False ,
120
113
fallback_import = False ,
121
- ) -> bool :
114
+ ) -> str :
122
115
# Only supported for current Py Exec Path, return True otherwise
123
116
if not prefer_pip :
124
117
try :
125
- return pkg_resources . get_distribution (cls .pypi_name ). version
118
+ return version (cls .pypi_name )
126
119
except :
127
120
pass
128
121
v = get_pip_lib_version (lib = cls .pypi_name , py_exec = python_exec_path )
Original file line number Diff line number Diff line change @@ -53,11 +53,8 @@ def run_test():
53
53
]
54
54
)
55
55
56
- import pkg_resources
56
+ pdf_example = str ( files ( "sparkocr" ). joinpath ( "resources/ocr/pdfs/tabular-pdf/data.pdf" ))
57
57
58
- pdf_example = pkg_resources .resource_filename (
59
- "sparkocr" , "resources/ocr/pdfs/tabular-pdf/data.pdf"
60
- )
61
58
pdf_example_df = spark .read .format ("binaryFile" ).load (pdf_example ).cache ()
62
59
pipeline .transform (pdf_example_df ).show ()
63
60
Original file line number Diff line number Diff line change 128
128
ContextualEntityRuler ,
129
129
PretrainedZeroShotNER ,
130
130
StructuredJsonConverter ,
131
+ BertForAssertionClassification ,
132
+ FhirDeIdentification
131
133
)
132
134
133
135
from sparknlp_jsl .modelTracer import ModelTracer
Original file line number Diff line number Diff line change 126
126
ContextualEntityRuler ,
127
127
PretrainedZeroShotNER ,
128
128
StructuredJsonConverter ,
129
+ BertForAssertionClassification ,
130
+ FhirDeIdentification
129
131
)
130
132
from sparknlp_jsl .modelTracer import ModelTracer
131
133
from sparknlp_jsl .pipeline_tracer import PipelineTracer
Original file line number Diff line number Diff line change 103
103
ContextualEntityRuler ,
104
104
PretrainedZeroShotNER ,
105
105
StructuredJsonConverter ,
106
+ BertForAssertionClassification ,
107
+ FhirDeIdentification
106
108
)
107
109
from sparknlp_jsl .structured_deidentification import StructuredDeidentification
108
110
from sparknlp_jsl .text_to_documents_columns import TextToDocumentsColumns
Original file line number Diff line number Diff line change 41
41
42
42
43
43
if try_import_lib ("pyspark" ):
44
- import pyspark .ml .param .shared as _shared_pyspark_ml_param
44
+ try :
45
+ import pyspark .ml .param .shared as _shared_pyspark_ml_param
46
+ except Exception as e :
47
+ try :
48
+ from pyspark .ml .param import shared as _shared_pyspark_ml_param
49
+ except Exception as e :
50
+ _shared_pyspark_ml_param = None
51
+
45
52
import pyspark .sql as SQL
46
53
import pyspark .sql .functions as F
47
54
import pyspark .sql .types as T
Original file line number Diff line number Diff line change 10
10
11
11
# These versions are used for auto-installs and version checks
12
12
13
- raw_version_jsl_lib = "5.5.5 "
13
+ raw_version_jsl_lib = "6.0.0 "
14
14
15
- raw_version_nlp = "5.5.3 "
15
+ raw_version_nlp = "6.0.0 "
16
16
17
17
raw_version_nlu = "5.4.1"
18
18
19
19
20
20
raw_version_pyspark = "3.4.0"
21
21
raw_version_nlp_display = "5.0"
22
22
23
- raw_version_medical = "5.5.3 "
24
- raw_version_secret_medical = "5.5.3 "
23
+ raw_version_medical = "6.0.0 "
24
+ raw_version_secret_medical = "6.0.0 "
25
25
26
- raw_version_secret_ocr = "5.5 .0"
27
- raw_version_ocr = "5.5 .0"
26
+ raw_version_secret_ocr = "6.0 .0"
27
+ raw_version_ocr = "6.0 .0"
28
28
29
29
raw_version_pydantic = "2"
30
30
Original file line number Diff line number Diff line change 17
17
import json
18
18
import sys
19
19
from urllib import request
20
- from pkg_resources import parse_version
20
+ from packaging . version import parse
21
21
22
22
23
23
def get_all_lib_version_on_pypi (pkg_name ):
24
24
url = f"https://pypi.python.org/pypi/{ pkg_name } /json"
25
25
releases = json .loads (request .urlopen (url ).read ())["releases" ]
26
- return sorted (releases , key = parse_version , reverse = True )
26
+ return sorted (releases , key = parse , reverse = True )
27
27
28
28
29
29
def get_latest_lib_version_on_pypi (pkg_name ):
Original file line number Diff line number Diff line change 9
9
10
10
from sparkocr .transformers import *
11
11
from sparkocr .enums import *
12
- import pkg_resources
13
12
import sparkocr
14
13
from sparkocr .utils import *
15
14
from sparkocr .schemas import *
You can’t perform that action at this time.
0 commit comments