flair
flair copied to clipboard
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.
Describe the bug `from hyperopt import hp from flair.hyperparameter.param_selection import SearchSpace, Parameter
search_space = SearchSpace()
define training hyperparameters
search_space.add(Parameter.EMBEDDINGS, hp.choice, options=[document_embeddings]) search_space.add(Parameter.LEARNING_RATE, hp.choice, options=[0.01, 0.05, 0.1, 0.15, 0.2]) search_space.add(Parameter.MINI_BATCH_SIZE, hp.choice, options=[8, 16, 32, 64, 128, 256])
define transformer embedding hyperparameters
search_space.add(Parameter.TRANSFORMER_MODEL, hp.choice, options=['gru', `'lstm'])``
`from flair.hyperparameter.param_selection import TextClassifierParamSelector, OptimizationValue
what label do we want to predict?
label_type = 'nation'
create the parameter selector
param_selector = TextClassifierParamSelector( corpus, label_type, False, 'resources/result', max_epochs=50, fine_tune=True, training_runs=3, optimization_value=OptimizationValue.DEV_SCORE )
start the optimization
param_selector.optimize(search_space, max_evals=100)`