Skip to content

Commit

Permalink
remove token option
Browse files Browse the repository at this point in the history
  • Loading branch information
ricwo committed Apr 20, 2018
1 parent 630dc89 commit 5751915
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/evaluation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The evaluation script `evaluate.py` allows you to test your models performance f
--model projects/default/model_20180323-145833
Where **model** specifies the model to evaluate on the test data specified
wioth **data**.
with **data**.

If you would like to evaluate your pipeline using
*cross-validation*, you can run the evaluation script with the mode
Expand Down
2 changes: 0 additions & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ What do these parameters mean?
- **config**: configuration of the machine learning model
- **data**: file or folder that contains the training data. You may instead
specify a URL from which to fetch training data with the ``--url`` option.
If you also need an authentication token, use the ``--token`` option in
addition.
- **path**: output path where the model is persisted to

If you want to know more about the parameters, there is an overview of the
Expand Down
13 changes: 2 additions & 11 deletions rasa_nlu/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ def create_argument_parser():
help="URL of the server from which to receive the "
"training data")

parser.add_argument('--token',
default=None,
help="Optional authentication string that might be "
"needed to retrieve training data from a URL. "
"The token gets appended to the query string "
"with `?token=<TOKEN>`.")

parser.add_argument('-c', '--config',
required=True,
help="Rasa NLU configuration file")
Expand Down Expand Up @@ -138,7 +131,6 @@ def do_train(cfg, # type: RasaNLUModelConfig
fixed_model_name=None, # type: Optional[Text]
storage=None, # type: Optional[Text]
component_builder=None, # type: Optional[ComponentBuilder]
token=None, # type: Optional[Text]
**kwargs # type: Any
):
# type: (...) -> Tuple[Trainer, Interpreter, Text]
Expand All @@ -149,7 +141,7 @@ def do_train(cfg, # type: RasaNLUModelConfig
# trained in another subprocess
trainer = Trainer(cfg, component_builder)
persistor = create_persistor(storage)
training_data = load_data(data, cfg.language, token)
training_data = load_data(data, cfg.language)
interpreter = trainer.train(training_data, **kwargs)

if path:
Expand All @@ -174,6 +166,5 @@ def do_train(cfg, # type: RasaNLUModelConfig
cmdline_args.project,
cmdline_args.fixed_model_name,
cmdline_args.storage,
num_threads=cmdline_args.num_threads,
token=cmdline_args.token)
num_threads=cmdline_args.num_threads)
logger.info("Finished training")
4 changes: 1 addition & 3 deletions rasa_nlu/training_data/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@
}


def load_data(resource_name, language='en', token=None):
def load_data(resource_name, language='en'):
# type: (Text, Optional[Text]) -> TrainingData
"""Load training data from disk or a URL.
Merges them if loaded from disk and multiple files are found."""

if utils.is_url(resource_name):
if token is not None:
resource_name += '?token={}'.format(token)
try:
response = requests.get(resource_name)
response.raise_for_status()
Expand Down

0 comments on commit 5751915

Please sign in to comment.