()
Download and unpack dialogs
Download and unpack dialogs
Download and unpack dialogs
def prepare_cornell_data():
    """Download and unpack dialogs"""

    zip_url = 'http://www.mpi-sws.org/~cristian/data/cornell_movie_dialogs_corpus.zip'
    zipfile_path = datasets_dir.joinpath('cornell.zip')

    if not datasets_dir.exists():
        datasets_dir.mkdir()

    # Prepare Dialog data
    if not cornell_dir.exists():
        print(f'Downloading {zip_url} to {zipfile_path}')
        urlretrieve(zip_url, zipfile_path)
        print(f'Successfully downloaded {zipfile_path}')

        zip_ref = ZipFile(zipfile_path, 'r')
        zip_ref.extractall(datasets_dir)
        zip_ref.close()

        datasets_dir.joinpath('cornell movie-dialogs corpus').rename(cornell_dir)

    else:
        print('Cornell Data prepared!')
def prepare_cornell_data ( ) : zip_url = 'http://www.mpi-sws.org/~cristian/data/cornell_movie_dialogs_corpus.zip' zipfile_path = datasets_dir . joinpath ( 'cornell.zip' ) if not datasets_dir . exists ( ) : datasets_dir . mkdir ( ) # Prepare Dialog data if not cornell_dir . exists ( ) : print ( f'Downloading {zip_url} to {zipfile_path}' ) urlretrieve ( zip_url , zipfile_path ) print ( f'Successfully downloaded {zipfile_path}' ) zip_ref = ZipFile ( zipfile_path , 'r' ) zip_ref . extractall ( datasets_dir ) zip_ref . close ( ) datasets_dir . joinpath ( 'cornell movie-dialogs corpus' ) . rename ( cornell_dir ) else : print ( 'Cornell Data prepared!' )