notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.utils.io
pickle_dump
Saves object to file.
Arguments:
filename
- the filename to save the object toobj
- the object to store
pickle_load
Loads an object from a file.
Arguments:
filename
- the filename to load the object fromReturns
- the loaded object
unarchive
Tries to unpack a byte array interpreting it as an archive.
Tries to use tar first to unpack, if that fails, zip will be used.
create_temporary_file
Creates a tempfile.NamedTemporaryFile object for data.
mode defines NamedTemporaryFile's mode parameter in py3.
create_temporary_directory
Creates a tempfile.TemporaryDirectory.
create_path
Makes sure all directories in the 'file_path' exists.
file_type_validator
Creates a Validator
class which can be used with questionary
to validate
file paths.
not_empty_validator
Creates a Validator
class which can be used with questionary
to validate
that the user entered something other than whitespace.
create_validator
Helper method to create Validator
classes from callable functions. Should be
removed when questionary supports Validator
objects.
json_unpickle
Unpickle an object from file using json.
Arguments:
file_name
- the file to load the object fromReturns
- the object
json_pickle
Pickle an object to a file using json.
Arguments:
file_name
- the file to store the object toobj
- the object to store
get_emoji_regex
Returns regex to identify emojis.