-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from JohnSnowLabs/release/511
Release/511
- Loading branch information
Showing
34 changed files
with
1,806 additions
and
213 deletions.
There are no files selected for viewing
607 changes: 485 additions & 122 deletions
607
...ent_examples/automatic_speech_recognition/automatic_speech_recognition_overview_ASR.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
__version__ = '5.0.3' | ||
__version__ = '5.1.1' | ||
|
||
|
||
import nlu.utils.environment.env_utils as env_utils | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from sparknlp.annotator import * | ||
|
||
|
||
class Whisper: | ||
@staticmethod | ||
def get_default_model(): | ||
return WhisperForCTC.pretrained() \ | ||
.setInputCols("audio_assembler") \ | ||
.setOutputCol("text") | ||
|
||
@staticmethod | ||
def get_pretrained_model(name, language, bucket=None): | ||
return WhisperForCTC.pretrained(name, language, bucket) \ | ||
.setInputCols("audio_assembler") \ | ||
.setOutputCol("text") |
18 changes: 18 additions & 0 deletions
18
nlu/components/embeddings/sentence_roberta/RobertaSentenceEmbedding.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from sparknlp.annotator import RoBertaSentenceEmbeddings | ||
|
||
|
||
class RobertaSentence: | ||
@staticmethod | ||
def get_default_model(): | ||
return RoBertaSentenceEmbeddings.pretrained() \ | ||
.setInputCols("sentence") \ | ||
.setOutputCol("sentence_embeddings") | ||
|
||
@staticmethod | ||
def get_pretrained_model(name, language, bucket=None): | ||
return RoBertaSentenceEmbeddings.pretrained(name,language,bucket) \ | ||
.setInputCols('sentence') \ | ||
.setOutputCol("sentence_embeddings") | ||
|
||
|
||
|
Empty file.
Empty file.
7 changes: 7 additions & 0 deletions
7
nlu/ocr_components/table_extractors/image2table/image2table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class IMAGE_TABLE_DETECTOR: | ||
@staticmethod | ||
def get_default_model(): | ||
from sparkocr.transformers import ImageTableDetector | ||
return ImageTableDetector.pretrained("general_model_table_detection_v2", "en", "clinical/ocr") \ | ||
.setInputCol("ocr_image") \ | ||
.setOutputCol("region") |
Empty file.
8 changes: 8 additions & 0 deletions
8
nlu/ocr_components/table_extractors/image2table_cell/image2table_cell.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class ImageTableCellDetector: | ||
@staticmethod | ||
def get_default_model(): | ||
from sparkocr.transformers import ImageTableCellDetector | ||
return ImageTableCellDetector() \ | ||
.setInputCol("image_region") \ | ||
.setAlgoType("morphops") \ | ||
.setOutputCol("ocr_table_cells") |
Empty file.
9 changes: 9 additions & 0 deletions
9
nlu/ocr_components/table_extractors/image_table_cell2text/image_table_cell2text.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ImageTable2Cell2TextTable: | ||
@staticmethod | ||
def get_default_model(): | ||
from sparkocr.transformers import ImageCellsToTextTable | ||
return ImageCellsToTextTable() \ | ||
.setInputCol("image_region") \ | ||
.setCellsCol('ocr_table_cells')\ | ||
.setOutputCol("ocr_table") | ||
|
Empty file.
14 changes: 14 additions & 0 deletions
14
nlu/ocr_components/utils/image_split_regions/image_split_regions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class ImageSplitRegions: | ||
@staticmethod | ||
def get_default_model(): | ||
from sparkocr.transformers import ImageSplitRegions | ||
return ImageSplitRegions() \ | ||
.setInputCol("ocr_image") \ | ||
.setInputRegionsCol("region") \ | ||
.setOutputCol("image_region") | ||
|
||
# .setInputRegionsCol("ocr_table_16969+ | ||
# | ||
# | ||
# | ||
# ") \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.