Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
amaiya committed Oct 12, 2020
2 parents a41bb2c + 875da80 commit 5c2e544
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ Most recent releases are shown at the top. Each release shows:
- **Changed**: Additional parameters, changes to inputs or outputs, etc
- **Fixed**: Bug fixes that don't change documented behaviour

## 0.22.4 (2020-10-12)

### New:
- N/A

### Changed
- changed `qa.core.display_answers` to make URLs open in new tab


### Fixed:
- pin to `seqeval==0.0.19` due to `numpy` version incompatibility with latest TensorFlow and to suppress errors during installation


## 0.22.3 (2020-10-09)

### New:
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@
```python
# End-to-End Open-Domain Question-Answering in ktrain

# index some documents into a built-in search engin
from ktrain import text
INDEXDIR = '/tmp/myindex'
text.SimpleQA.initialize_index(INDEXDIR)
text.SimpleQA.index_from_list(docs, INDEXDIR, commit_every=len(docs),
text.SimpleQA.index_from_list(docs, INDEXDIR, commit_every=len(docs), # docs is a list of strings
multisegment=True, procs=4, # these args speed up indexing
breakup_docs=True) # this slows indexing but speeds up answer retrieval
qa = text.SimpleQA(INDEXDIR)

# setting higher batch size can further speed up answer retreival
# ask questions (setting higher batch size can further speed up answer retrieval)
qa = text.SimpleQA(INDEXDIR)
answers = qa.ask('What causes computer images to be too dark?', batch_size=8)

# top answer snippet:
Expand Down
2 changes: 1 addition & 1 deletion ktrain/text/qa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def _answers2df(answers):
dfdata.append([answer_text, snippet_html, confidence, doc_key])
df = pd.DataFrame(dfdata, columns = ['Candidate Answer', 'Context', 'Confidence', 'Document Reference'])
if "\t" in answers[0]['reference']:
df['Document Reference'] = df['Document Reference'].apply(lambda x: '<a href="{}">{}</a>'.format(x.split('\t')[1], x.split('\t')[0]))
df['Document Reference'] = df['Document Reference'].apply(lambda x: '<a href="{}" target="_blank">{}</a>'.format(x.split('\t')[1], x.split('\t')[0]))
return df


Expand Down
2 changes: 1 addition & 1 deletion ktrain/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__all__ = ['__version__']
__version__ = '0.22.3'
__version__ = '0.22.4'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'cchardet', # previously pinned to 2.1.5 (due to this issue: https://github.com/PyYoshi/cChardet/issues/61) but no longer needed
'networkx>=2.3',
'bokeh',
'seqeval',
'seqeval==0.0.19', # pin to 0.0.19 due to numpy version incompatibility with TensorFlow 2.3
'packaging',
'transformers>=3.1.0', # due to breaking change in v3.1.0
'ipython',
Expand Down

0 comments on commit 5c2e544

Please sign in to comment.