Skip to content

Commit

Permalink
Update badges and minor extra check on the data
Browse files Browse the repository at this point in the history
  • Loading branch information
kororo committed Aug 25, 2020
1 parent 21f3c27 commit 34d1fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README.md
@@ -1,8 +1,8 @@
ExcelCy
=======

[![Travis (.org)](https://img.shields.io/travis/kororo/excelcy)](https://pypi.python.org/project/excelcy/)
[![Coverage Status](https://coveralls.io/repos/github/kororo/excelcy/badge.svg?branch=master)](https://coveralls.io/github/kororo/excelcy?branch=master)
[![Build Status](https://travis-ci.com/kororo/excelcy.svg?branch=master)](https://travis-ci.com/kororo/excelcy)
[![Coverage Status](https://coveralls.io/repos/github/kororo/excelcy/badge.svg)](https://coveralls.io/github/kororo/excelcy)
[![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://lbesson.mit-license.org/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/excelcy.svg)](https://pypi.python.org/project/excelcy/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/excelcy)](https://pypi.python.org/project/excelcy/)
Expand Down Expand Up @@ -50,6 +50,8 @@ from excelcy import ExcelCy
excelcy = ExcelCy()
# by default it is assume the nlp_base using model en_core_web_sm
# excelcy.storage.config = Config(nlp_base='en_core_web_sm')
# if you have existing model, use this
# excelcy.storage.config = Config(nlp_path='/path/model')
doc = excelcy.nlp('John is the CEO of this_is_a_unique_company_name')
# it will show no company entities
print([(ent.label_, ent.text) for ent in doc.ents])
Expand Down
2 changes: 1 addition & 1 deletion excelcy/excelcy.py
Expand Up @@ -221,7 +221,7 @@ def train(self):
# ensure offset is valid positions
if not gold.offset:
offset = train.text.find(gold.subtext)
if offset != -1:
if offset != -1 or gold.offset is None:
gold.offset = '%s,%s' % (offset, offset + len(gold.subtext))
offset = gold.offset.replace(' ', '').strip()
if not entities.get(offset):
Expand Down

0 comments on commit 34d1fe1

Please sign in to comment.