adalib.keywords
¶
The Keywords sub-package exposes the core integrations of the keywords in the AdaLab Gallery.
Functions¶
create_keywords ¶
Add a new keyword to the Gallery.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
new_keyword |
str | list
|
name (or names) of the keywords to be added |
required |
Returns:
Type | Description |
---|---|
list
|
a list of dictionaries with the new keyword ids |
Source code in adalib/keywords/keywords.py
delete_keywords ¶
Delete keywords from the Gallery.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keywords |
str | list[str]
|
keywords to be deleted (tip: all names must be valid, otherwise the process fails) |
required |
Returns:
Type | Description |
---|---|
None
|
Nothing |
Source code in adalib/keywords/keywords.py
delete_keywords_by_id ¶
Delete keywords from the Gallery based on their ids.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keyword_ids |
str | list[str]
|
ids of the keywords to be deleted (tip: all ids must be valid, otherwise the process fails) |
required |
Returns:
Type | Description |
---|---|
None
|
Nothing |
Source code in adalib/keywords/keywords.py
get_keyword_id ¶
Find the ID for a specific keyword.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keyword |
str
|
name of the keyword |
required |
Returns:
Type | Description |
---|---|
int | None
|
id of the keyword, or None if keyword not found |
Source code in adalib/keywords/keywords.py
get_keywords ¶
Get information about all keywords in the Gallery.
Use the example Jupyter Notebook to test this function or build upon it.
Returns:
Type | Description |
---|---|
list
|
list of dictionaries with keywords data |
Source code in adalib/keywords/keywords.py
get_keywords_stats ¶
Get utilization statistics for the keywords in the Gallery.
Use the example Jupyter Notebook to test this function or build upon it.
Returns:
Type | Description |
---|---|
list
|
list of dictionaries with keywords stats |
Source code in adalib/keywords/keywords.py
merge_keywords ¶
Merge several keywords into a single one.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keywords |
list[str]
|
keywords to be merged |
required |
new_keyword |
str
|
name of the new keyword (note: it can be one of the keywords to be merged) |
required |
Returns:
Type | Description |
---|---|
int
|
the new keyword's ID |
Source code in adalib/keywords/keywords.py
rename_keyword ¶
Rename a keyword.
Use the example Jupyter Notebook to test this function or build upon it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keyword |
str
|
the keyword to be renamed |
required |
new_keyword |
str
|
name of the new keyword |
required |
Returns:
Type | Description |
---|---|
int
|
new keyword's id |