Skip to content

Commit

Permalink
implement review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wochinge committed Jan 31, 2019
1 parent 4f2dd49 commit 0497358
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rasa_nlu/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _build_pipeline(cfg: RasaNLUModelConfig,

return pipeline

def train(self, data: TrainingData, **kwargs: Any)-> 'Interpreter':
def train(self, data: TrainingData, **kwargs: Any) -> 'Interpreter':
"""Trains the underlying pipeline using the provided training data."""

self.training_data = data
Expand Down Expand Up @@ -193,7 +193,7 @@ def persist(self,
path: Text,
persistor: Optional[Persistor] = None,
project_name: Text = None,
fixed_model_name: Text = None)-> Text:
fixed_model_name: Text = None) -> Text:
"""Persist all components of the pipeline to the passed path.
Returns the directory of the persisted model."""
Expand Down
6 changes: 3 additions & 3 deletions rasa_nlu/tokenizers/spacy_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class SpacyTokenizer(Tokenizer, Component):
def train(self,
training_data: TrainingData,
config: RasaNLUModelConfig,
**kwargs: Any)-> None:
**kwargs: Any) -> None:

for example in training_data.training_examples:
example.set("tokens", self.tokenize(example.get("spacy_doc")))

def process(self, message: Message, **kwargs: Any)-> None:
def process(self, message: Message, **kwargs: Any) -> None:

message.set("tokens", self.tokenize(message.get("spacy_doc")))

def tokenize(self, doc: 'Doc')-> typing.List[Token]:
def tokenize(self, doc: 'Doc') -> typing.List[Token]:

return [Token(t.text, t.idx) for t in doc]
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# pytest pycodestyle configuration
[tool:pytest]
codestyle_max_line_length = 80
# ignoring W504: line break occurred after a binary operator
codestyle_ignore =
E251
W504
codestyle_exclude =
docs/conf.py
Expand Down

0 comments on commit 0497358

Please sign in to comment.