Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiu44 committed Oct 18, 2021
1 parent c759633 commit 8c8590f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cube/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ def __call__(self, text: Union[str, Document], flavour: Optional[str] = None):
self._lm_helper.apply(doc)
self._parser.process(doc, self._parser_collate, num_workers=0)
self._lemmatizer.process(doc, self._lemmatizer_collate, num_workers=0)
for seq in doc.sentences:
for w in seq.words:
if w.upos =='PUNCT':
w.lemma = w.word
return doc


Expand Down
4 changes: 2 additions & 2 deletions cube/networks/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def forward(self, X):
for ii in range(len(x_word_emb_packed)):
we = unpack(x_word_emb_packed[ii], sl, x_sents.shape[1], self._get_device())
if word_emb_ext is None:
word_emb_ext = self._ext_proj[ii](we)
word_emb_ext = self._ext_proj[ii](we.float())
else:
word_emb_ext = word_emb_ext + self._ext_proj[ii](we)
word_emb_ext = word_emb_ext + self._ext_proj[ii](we.float())

word_emb_ext = word_emb_ext / len(x_word_emb_packed)
word_emb_ext = torch.tanh(word_emb_ext)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def parse_requirements(filename, session=None):

setuptools.setup(
name="nlpcube",
version="0.3.1.0",
version="0.3.1.1",
author="Multiple authors",
author_email="[email protected]",
description="Natural Language Processing Toolkit with support for tokenization, sentence splitting, lemmatization, tagging and parsing for more than 60 languages",
Expand Down

0 comments on commit 8c8590f

Please sign in to comment.