Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #121

Open
NouamaneTazi opened this issue Feb 1, 2020 · 0 comments
Open

IndexError: list index out of range #121

NouamaneTazi opened this issue Feb 1, 2020 · 0 comments

Comments

@NouamaneTazi
Copy link

IndexError Traceback (most recent call last)
in ()
7 }
8
----> 9 pprint(normalise(cleaned_corpus))

7 frames
/usr/local/lib/python3.6/dist-packages/normalise/normalisation.py in normalise(text, tokenizer, verbose, variety, user_abbrevs)
155 return insert(tokenizer(text), verbose=verbose, variety=variety, user_abbrevs=user_abbrevs)
156 else:
--> 157 return insert(text, verbose=verbose, variety=variety, user_abbrevs=user_abbrevs)
158
159

/usr/local/lib/python3.6/dist-packages/normalise/normalisation.py in insert(text, verbose, variety, user_abbrevs)
161 (expanded_ALPHA,
162 expanded_NUMB,
--> 163 expanded_MISC) = list_NSWs(text, verbose=verbose, variety=variety, user_abbrevs=user_abbrevs)
164 out = text[:]
165 split_dict = {}

/usr/local/lib/python3.6/dist-packages/normalise/normalisation.py in list_NSWs(text, verbose, variety, user_abbrevs)
69 print("CLASSIFYING ALPHABETIC NSWs")
70 print("---------------------------\n")
---> 71 tagged_ALPHA = run_clfALPHA(ALPHA_dict, text, verbose=verbose, user_abbrevs=user_abbrevs)
72 if verbose:
73 print("CLASSIFYING NUMERIC NSWs")

/usr/local/lib/python3.6/dist-packages/normalise/class_ALPHA.py in run_clfALPHA(dic, text, verbose, user_abbrevs)
96 out.update({ind: (nsw, 'ALPHA', 'EXPN')})
97 else:
---> 98 pred_int = int(clf.predict(gen_featuresetsALPHA({ind: (nsw, tag)}, text)))
99 ntag = int_tag_dict[pred_int]
100 out.update({ind: (nsw, tag, ntag)})

/usr/local/lib/python3.6/dist-packages/normalise/class_ALPHA.py in gen_featuresetsALPHA(tagged_dict, text)
109 """Return an array for features for each item in the input dict."""
110 return np.array([give_featuresALPHA(item, text)
--> 111 for item in tagged_dict.items()],
112 dtype=float)
113

/usr/local/lib/python3.6/dist-packages/normalise/class_ALPHA.py in (.0)
109 """Return an array for features for each item in the input dict."""
110 return np.array([give_featuresALPHA(item, text)
--> 111 for item in tagged_dict.items()],
112 dtype=float)
113

/usr/local/lib/python3.6/dist-packages/normalise/class_ALPHA.py in give_featuresALPHA(item, text)
116 """Return a list of features for a dictionary item."""
117 ind, nsw, tag = item[0], item[1][0], item[1][1]
--> 118 context = gen_frame(item, text)
119 out = [
120

/usr/local/lib/python3.6/dist-packages/normalise/class_NUMB.py in gen_frame(dict_tup, text)
387 else:
388 rind = round(ind)
--> 389 full = text[rind]
390 start = ''
391 end = ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant