layernext-beta 2.4.0b2__tar.gz → 2.4.0b3__tar.gz
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.
- {layernext-beta-2.4.0b2/layernext_beta.egg-info → layernext-beta-2.4.0b3}/PKG-INFO +6 -1
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/__init__.py +98 -5
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/__init__.py +53 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/constants.py +4 -2
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/datalakeinterface.py +360 -242
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/dataset/datasetinterface.py +8 -8
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/dataset/sync.py +2 -2
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/studio/studiointerface.py +8 -8
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3/layernext_beta.egg-info}/PKG-INFO +6 -1
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/LICENSE +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/README.md +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/automatic_analysis/__init__.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/automatic_analysis/automatic_analysis.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/automatic_analysis/automatic_analysis_interface.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/automatic_analysis/status_check_autoannotate_project.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/automatic_analysis/support.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/annotation.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/aws_s3_client.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/azure_client.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/dataset.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/file_trash.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/file_upload.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/gcs_client.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/ground_truth.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/keys.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/label.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/logger.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/metadata.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/model_run.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/query.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/storage_client.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/storage_interface.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/datalake/storage_upload.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/dataset/__init__.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/dataset/dataset.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/dataset/logger.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/studio/__init__.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/studio/logger.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext/studio/project.py +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext_beta.egg-info/SOURCES.txt +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext_beta.egg-info/dependency_links.txt +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext_beta.egg-info/requires.txt +5 -5
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/layernext_beta.egg-info/top_level.txt +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/setup.cfg +0 -0
- {layernext-beta-2.4.0b2 → layernext-beta-2.4.0b3}/setup.py +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: layernext-beta
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.0b3
|
|
4
4
|
Summary: LayerNext Python SDK
|
|
5
|
+
Home-page: UNKNOWN
|
|
5
6
|
Author: LayerNext
|
|
6
7
|
Author-email: <support@layernext.ai>
|
|
8
|
+
License: UNKNOWN
|
|
7
9
|
Keywords: python,datalake,datasetsync,ai,annotation,layernext,layernext,machine learning
|
|
10
|
+
Platform: UNKNOWN
|
|
8
11
|
Classifier: Development Status :: 1 - Planning
|
|
9
12
|
Classifier: Intended Audience :: Developers
|
|
10
13
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -37,3 +40,5 @@ url = 'https://api.xxxx.layernext.ai'
|
|
|
37
40
|
client = layernext.LayerNextClient(api_key, secret, url)
|
|
38
41
|
|
|
39
42
|
```
|
|
43
|
+
|
|
44
|
+
|
|
@@ -8,7 +8,7 @@ from layernext.datalake.constants import (AnnotationUploadType, ItemType, JobSta
|
|
|
8
8
|
SortFieldName, SortOrder, AnnotationShapeType)
|
|
9
9
|
from deprecated import deprecated
|
|
10
10
|
|
|
11
|
-
__version__ = '2.4.
|
|
11
|
+
__version__ = '2.4.0b3'
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class LayerNextClient:
|
|
@@ -784,6 +784,8 @@ class LayerNextClient:
|
|
|
784
784
|
modified_sort["sortByField"] = SortField.SIZE.value
|
|
785
785
|
elif field == SortFieldName.VIDEO_INDEX.value:
|
|
786
786
|
modified_sort["sortByField"] = SortField.VIDEO_INDEX.value
|
|
787
|
+
elif field == SortFieldName.TEXT_SCORE.value:
|
|
788
|
+
modified_sort["sortByField"] = SortField.TEXT_SCORE.value
|
|
787
789
|
else:
|
|
788
790
|
valid_fields: list = self.get_valid_sort_fields()
|
|
789
791
|
raise Exception(
|
|
@@ -802,7 +804,9 @@ class LayerNextClient:
|
|
|
802
804
|
"date": {},
|
|
803
805
|
"tags": [],
|
|
804
806
|
"labels": [],
|
|
805
|
-
"metadata": {}
|
|
807
|
+
"metadata": {},
|
|
808
|
+
"keywords": [],
|
|
809
|
+
"categories": []
|
|
806
810
|
}
|
|
807
811
|
if "annotation_types" in filter:
|
|
808
812
|
if "human" in filter["annotation_types"]:
|
|
@@ -815,6 +819,10 @@ class LayerNextClient:
|
|
|
815
819
|
return_filter["date"]["toDate"] = filter["to_date"]
|
|
816
820
|
if "from_date" in filter:
|
|
817
821
|
return_filter["date"]["fromDate"] = filter["from_date"]
|
|
822
|
+
if "keywords" in filter:
|
|
823
|
+
return_filter["keywords"] = filter["keywords"]
|
|
824
|
+
if "categories" in filter:
|
|
825
|
+
return_filter["categories"] = filter["categories"]
|
|
818
826
|
return return_filter
|
|
819
827
|
|
|
820
828
|
"""
|
|
@@ -2239,7 +2247,7 @@ class LayerNextClient:
|
|
|
2239
2247
|
@filter: {date: {fromDate: "", toDate: ""}, "annotation_types": ["human", "raw", "machine"]}
|
|
2240
2248
|
@page_index - index of the page
|
|
2241
2249
|
@page_size - size of the page, maximum = 1000
|
|
2242
|
-
@sort_order: {sort_by_field:"date_modified"/"date_created"/"name"/"size"/"video_index", sort_order: "ASC/DESC"}
|
|
2250
|
+
@sort_order: {sort_by_field:"date_modified"/"date_created"/"name"/"size"/"video_index"/"text_score", sort_order: "ASC/DESC"}
|
|
2243
2251
|
"""
|
|
2244
2252
|
|
|
2245
2253
|
def get_item_list_from_datalake(
|
|
@@ -2756,7 +2764,15 @@ class LayerNextClient:
|
|
|
2756
2764
|
unique_names,
|
|
2757
2765
|
model_name
|
|
2758
2766
|
)
|
|
2759
|
-
|
|
2767
|
+
"""
|
|
2768
|
+
Use to create or update job in metalake
|
|
2769
|
+
@session_id : string - session id
|
|
2770
|
+
@job_name : string - job name
|
|
2771
|
+
@job_type : enum - type of job (enum)
|
|
2772
|
+
@progress : int - progress of created or update job
|
|
2773
|
+
@status : enum - complete, in_progress.. (enum)
|
|
2774
|
+
@job_detail : dict - job specific details
|
|
2775
|
+
"""
|
|
2760
2776
|
def create_or_update_job(
|
|
2761
2777
|
self,
|
|
2762
2778
|
session_id:str,
|
|
@@ -2782,6 +2798,31 @@ class LayerNextClient:
|
|
|
2782
2798
|
status,
|
|
2783
2799
|
job_detail
|
|
2784
2800
|
)
|
|
2801
|
+
|
|
2802
|
+
"""
|
|
2803
|
+
Use to find documents matching for given keywords and categories
|
|
2804
|
+
@unique_name: List[str] - unique name of the required embeddings
|
|
2805
|
+
@model_name: List[str] - model name of the required embeddings
|
|
2806
|
+
@page_index: int - index of the page
|
|
2807
|
+
@page_size: int - size of the page, maximum = 1000
|
|
2808
|
+
"""
|
|
2809
|
+
def find_documents(
|
|
2810
|
+
self,
|
|
2811
|
+
keywords: List[str],
|
|
2812
|
+
categories: List[str],
|
|
2813
|
+
page_index=0,
|
|
2814
|
+
page_size=1,
|
|
2815
|
+
):
|
|
2816
|
+
return self.get_item_list_from_datalake(
|
|
2817
|
+
item_type='other',
|
|
2818
|
+
filter={
|
|
2819
|
+
"keywords": keywords,
|
|
2820
|
+
"categories": categories
|
|
2821
|
+
},
|
|
2822
|
+
page_index=page_index,
|
|
2823
|
+
page_size=page_size,
|
|
2824
|
+
sort_order={"sort_by_field": "text_score", "sort_order": "DESC"}
|
|
2825
|
+
)
|
|
2785
2826
|
|
|
2786
2827
|
|
|
2787
2828
|
"""
|
|
@@ -2858,4 +2899,56 @@ class LayerNextClient:
|
|
|
2858
2899
|
return {
|
|
2859
2900
|
"isSuccess": False,
|
|
2860
2901
|
"error": "Failed to get selection id"
|
|
2861
|
-
}
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
|
|
2905
|
+
"""
|
|
2906
|
+
find chunk by search keys from text
|
|
2907
|
+
@param search_key_list - list of search keys
|
|
2908
|
+
@param unique_name_list - list of unique names
|
|
2909
|
+
return array of chunks
|
|
2910
|
+
example search_key_list - ["tax", "discount"]
|
|
2911
|
+
example unique_name_list - ["abc.pdf", "def.pdf"]
|
|
2912
|
+
example response - [
|
|
2913
|
+
'# 000009752 Description Date Credited Amount Deposit Ref Nbr: 130012345 05-15 $3,615.08 Total Deposits & Other Credits $3,615.08 ATM Withdrawals & Debits Account # 000009752 Description Tran Date Date Paid Amount ATM',
|
|
2914
|
+
'Debits $20.00 ChecksPaid Account # 000009752 Date Paid Check Number Amount Reference Number 05-12 1001 75.00 00012576589 05-18 1002 30.00 00036547854 05-24 1003 200.00 00094613547 Total Checks Paid',
|
|
2915
|
+
'Purchases & Debits -0.00 Withdrawals & Other Debits -0.00 Checks Paid -200.00 Ending Balance on June 5, 2003 $10,521.19 Deposits & Other Credits Account # 000009752 Description Date Credited Amount Deposit Ref'
|
|
2916
|
+
]
|
|
2917
|
+
"""
|
|
2918
|
+
def find_chunk(
|
|
2919
|
+
self,
|
|
2920
|
+
search_key_list: [str],
|
|
2921
|
+
unique_name_list: List[str],
|
|
2922
|
+
):
|
|
2923
|
+
print(f'find chunk - search_key_list: {search_key_list}, unique_name_list: {unique_name_list}')
|
|
2924
|
+
|
|
2925
|
+
_datalake_client = datalake.DatalakeClient(
|
|
2926
|
+
self.encoded_key_secret, self.layernext_url)
|
|
2927
|
+
|
|
2928
|
+
response = _datalake_client.find_chunk(
|
|
2929
|
+
search_key_list, unique_name_list)
|
|
2930
|
+
|
|
2931
|
+
return response
|
|
2932
|
+
|
|
2933
|
+
|
|
2934
|
+
"""
|
|
2935
|
+
Use to get data dictionary
|
|
2936
|
+
"""
|
|
2937
|
+
def get_data_dictionary(self):
|
|
2938
|
+
_datalake_client = datalake.DatalakeClient(
|
|
2939
|
+
self.encoded_key_secret, self.layernext_url)
|
|
2940
|
+
|
|
2941
|
+
return _datalake_client.get_data_dictionary()
|
|
2942
|
+
|
|
2943
|
+
|
|
2944
|
+
"""
|
|
2945
|
+
Use to execute mongo db query
|
|
2946
|
+
@function : This can be 'aggregate', 'find', 'updateMany', etc.
|
|
2947
|
+
@input_data : The input parameters for the MongoDB function, provided as a JSON-like dictionary or list
|
|
2948
|
+
@collection : The name of the MongoDB collection on which the query is to be run
|
|
2949
|
+
"""
|
|
2950
|
+
def execute_mongo_query(self, function, input_data, collection):
|
|
2951
|
+
_datalake_client = datalake.DatalakeClient(
|
|
2952
|
+
self.encoded_key_secret, self.layernext_url)
|
|
2953
|
+
|
|
2954
|
+
return _datalake_client.execute_mongo_query(function, input_data, collection)
|
|
@@ -576,6 +576,9 @@ class DatalakeClient:
|
|
|
576
576
|
|
|
577
577
|
return res
|
|
578
578
|
|
|
579
|
+
"""
|
|
580
|
+
update or create virtual collection
|
|
581
|
+
"""
|
|
579
582
|
def update_virtual_collection(self, virtual_collection_name: str = None,
|
|
580
583
|
virtual_collection_id: str = None,
|
|
581
584
|
selection_id: str = None):
|
|
@@ -592,3 +595,53 @@ class DatalakeClient:
|
|
|
592
595
|
res = self.datalake_interface.update_virtual_collection(payload)
|
|
593
596
|
|
|
594
597
|
return res
|
|
598
|
+
|
|
599
|
+
"""
|
|
600
|
+
find chunk by search keys from text
|
|
601
|
+
"""
|
|
602
|
+
def find_chunk(self, search_key_list: [str],
|
|
603
|
+
unique_name_list: List[str]):
|
|
604
|
+
payload = {
|
|
605
|
+
"searchKeys": search_key_list,
|
|
606
|
+
"uniqueNames": unique_name_list
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
res = self.datalake_interface.find_chunk(payload)
|
|
610
|
+
|
|
611
|
+
return res
|
|
612
|
+
"""
|
|
613
|
+
Use to get data dictionary
|
|
614
|
+
"""
|
|
615
|
+
def get_data_dictionary(self):
|
|
616
|
+
res = self.datalake_interface.get_data_dictionary()
|
|
617
|
+
if "isSuccess" in res and res["isSuccess"] == False:
|
|
618
|
+
raise Exception(res["message"])
|
|
619
|
+
if 'isSuccess' in res:
|
|
620
|
+
if res["isSuccess"] == False:
|
|
621
|
+
message = res['message']
|
|
622
|
+
print(f'Success false with. message: {message}')
|
|
623
|
+
raise Exception(message)
|
|
624
|
+
else:
|
|
625
|
+
print('Successfully extract the dictionary data')
|
|
626
|
+
return res['data']
|
|
627
|
+
else:
|
|
628
|
+
print('Request return with unexpected results')
|
|
629
|
+
raise Exception('Request return with unexpected results')
|
|
630
|
+
|
|
631
|
+
"""
|
|
632
|
+
Use to execute mongo db query
|
|
633
|
+
@function : This can be 'aggregate', 'find', 'updateMany', etc.
|
|
634
|
+
@input_data : The input parameters for the MongoDB function, provided as a JSON-like dictionary or list
|
|
635
|
+
@collection : The name of the MongoDB collection on which the query is to be run
|
|
636
|
+
"""
|
|
637
|
+
def execute_mongo_query(self, function, input_data, collection):
|
|
638
|
+
|
|
639
|
+
payload = {
|
|
640
|
+
'function': function,
|
|
641
|
+
'query': input_data,
|
|
642
|
+
'collection': collection
|
|
643
|
+
}
|
|
644
|
+
res = self.datalake_interface.execute_mongo_query(payload)
|
|
645
|
+
return res
|
|
646
|
+
|
|
647
|
+
|
|
@@ -85,7 +85,8 @@ class SortFieldName(Enum):
|
|
|
85
85
|
DATE_CREATED = "date_created"
|
|
86
86
|
NAME = "name"
|
|
87
87
|
SIZE = "size"
|
|
88
|
-
VIDEO_INDEX = "video_index"
|
|
88
|
+
VIDEO_INDEX = "video_index",
|
|
89
|
+
TEXT_SCORE = "text_score"
|
|
89
90
|
|
|
90
91
|
|
|
91
92
|
class SortField(Enum):
|
|
@@ -93,7 +94,8 @@ class SortField(Enum):
|
|
|
93
94
|
DATE_CREATED = 2
|
|
94
95
|
NAME = 3
|
|
95
96
|
SIZE = 4
|
|
96
|
-
VIDEO_INDEX = 6
|
|
97
|
+
VIDEO_INDEX = 6,
|
|
98
|
+
TEXT_SCORE = 7
|
|
97
99
|
|
|
98
100
|
|
|
99
101
|
class SortOrder(Enum):
|