Skip to content

Commit

Permalink
fixed remaining pep8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbo committed Nov 28, 2016
1 parent 2eefe06 commit 035eb90
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 28 deletions.
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pytest PEP8 configuration
[tool:pytest]
pep8maxlinelength = 120
pep8maxlinelength = 120
pep8ignore =
docs/conf.py ALL
39 changes: 20 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
from setuptools import setup

setup(
name = 'rasa_nlu',
packages = [
'rasa_nlu',
'rasa_nlu.classifiers',
'rasa_nlu.emulators',
'rasa_nlu.extractors',
'rasa_nlu.featurizers',
'rasa_nlu.interpreters',
'rasa_nlu.trainers',
'rasa_nlu.tokenizers'
],
package_dir = {'rasa_nlu': 'src'},
version = '0.3.0',
install_requires=[
name='rasa_nlu',
packages=[
'rasa_nlu',
'rasa_nlu.classifiers',
'rasa_nlu.emulators',
'rasa_nlu.extractors',
'rasa_nlu.featurizers',
'rasa_nlu.interpreters',
'rasa_nlu.trainers',
'rasa_nlu.tokenizers'
],
package_dir={'rasa_nlu': 'src'},
version='0.3.0',
install_requires=[
'pytest'
],
description = "rasa_nlu: a natural language parser for bots",
author = 'Alan Nichol',
author_email = '[email protected]',
url="http://rasa.ai"
],
description="rasa_nlu: a natural language parser for bots",
author='Alan Nichol',
author_email='[email protected]',
url="http://rasa.ai"
)
9 changes: 7 additions & 2 deletions src/server.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import argparse
import json
import os
import urlparse
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import urlparse, json, argparse, os

from rasa_nlu.util import update_config


Expand Down Expand Up @@ -50,7 +54,8 @@ def create_argparser():
help='which service to emulate (default: None i.e. use simple built in format)')
parser.add_argument('-P', '--port', default=5000, type=int, help='port on which to run server')
parser.add_argument('-c', '--config', default=None,
help="config file, all the command line options can also be passed via a (json-formatted) config file. NB command line args take precedence")
help="config file, all the command line options can also be passed via a (json-formatted) " +
"config file. NB command line args take precedence")
parser.add_argument('-w', '--write', default='rasa_nlu_log.json', help='file where logs will be saved')
parser.add_argument('-l', '--language', default='en', choices=['de', 'en'], help="model and data language")

Expand Down
2 changes: 1 addition & 1 deletion src/trainers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
class Interpreter(object):
def parse(self, text):
raise NotImplementedError()
raise NotImplementedError()
3 changes: 1 addition & 2 deletions src/trainers/mitie_sklearn_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def start_and_end(self, text_tokens, entity_tokens):
max_loc = 1 + len(text_tokens) - size
# for i in range(max_loc):
# print("slice at {0} : {1}".format(i,text_tokens[i:i+size]))
locs = [i for i in range(max_loc) if \
text_tokens[i:i + size] == entity_tokens]
locs = [i for i in range(max_loc) if text_tokens[i:i + size] == entity_tokens]
# print(locs)
start, end = locs[0], locs[0] + len(entity_tokens)
return start, end
Expand Down
3 changes: 1 addition & 2 deletions src/trainers/mitie_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def start_and_end(self, text_tokens, entity_tokens):
max_loc = 1 + len(text_tokens) - size
# for i in range(max_loc):
# print("slice at {0} : {1}".format(i,text_tokens[i:i+size]))
locs = [i for i in range(max_loc) if \
text_tokens[i:i + size] == entity_tokens]
locs = [i for i in range(max_loc) if text_tokens[i:i + size] == entity_tokens]
# print(locs)
start, end = locs[0], locs[0] + len(entity_tokens)
return start, end
Expand Down
6 changes: 5 additions & 1 deletion src/training_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# -*- coding: utf-8 -*-

import json, warnings, re, os, codecs
import codecs
import json
import re
import warnings

from rasa_nlu import util


Expand Down

0 comments on commit 035eb90

Please sign in to comment.