-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/linyh97/Nucleus
merge test_bert test case from minghao
- Loading branch information
Showing
52 changed files
with
10,053 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ models/bert/model_data | |
models/bert/.idea | ||
models/bert/sample_text.txt | ||
|
||
draft.py | ||
|
||
# C extensions | ||
*.so | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ In context-free mode, things become more interesting. At the very beginning we o | |
|
||
In context-free mode, you don't need to provide a context, we do this for you - we use abundant wikipedia API to search the most possible page that may contain answer. Calling multiple APIs including Wikipedia API, rake_nltk, etc. | ||
|
||
If you have any questions during the installation or operation of Nucleus, please feel free to open an issue. | ||
|
||
|
||
## Get Started | ||
|
@@ -39,7 +40,9 @@ database_pwd = <your_database_password> | |
|
||
### Find model | ||
|
||
Download the model via `https://1drv.ms/f/s!AtfKeiTxgnoqjt0M3lrLoowcsjbKcA`, name the whole dir as `model_data`, and put it to `<root>/models/bert` | ||
Download the model via `https://1drv.ms/f/s!AtfKeiTxgnoqjt0M3lrLoowcsjbKcA`, name the whole dir as `model_data`, and put it to `<root>/models/bert` Please note that the r_net mode is now deprecated. You can try it if you want or you only have limited computation resources. | ||
|
||
If you cannot download the model, please contact us at `[email protected]` | ||
|
||
### Test cases | ||
|
||
|
@@ -85,3 +88,13 @@ The basic workflow of our context-free mode is: | |
4. we split these pages into a list of paragraphs, each of which is about 700 characters long; | ||
5. we put the list of paragraphs as contexts and the question into BERT model, and the model returns an answer and a confidence for each of question-context pair; | ||
6. we select the answer with the best confidence, and return it to the user. | ||
|
||
## Reference | ||
|
||
https://github.com/google-research/bert | ||
https://github.com/HKUST-KnowComp/R-Net | ||
https://github.com/tensorflow/tensorflow | ||
https://github.com/pallets/flask | ||
https://github.com/goldsmith/Wikipedia | ||
https://github.com/capless/warrant | ||
https://github.com/csurfer/rake-nltk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
Name Stmts Miss Cover | ||
------------------------------------------------- | ||
config.py 6 0 100% | ||
database/db_update_class.py 90 33 63% | ||
models/r_net/func.py 153 42 73% | ||
models/r_net/inference.py 184 5 97% | ||
models/r_net/prepro.py 187 161 14% | ||
test/test_database.py 235 5 98% | ||
------------------------------------------------- | ||
TOTAL 855 246 71% | ||
Name Stmts Miss Cover | ||
--------------------------------------------------- | ||
config.py 6 0 100% | ||
database/db_update_class.py 103 35 66% | ||
models/bert/inference_bert.py 518 114 78% | ||
models/bert/modeling.py 301 39 87% | ||
models/bert/optimization.py 68 56 18% | ||
models/bert/tokenization.py 202 42 79% | ||
models/r_net/func.py 153 42 73% | ||
models/r_net/inference.py 183 5 97% | ||
models/r_net/prepro.py 187 161 14% | ||
test/test_bert.py 16 0 100% | ||
test/test_database.py 248 5 98% | ||
--------------------------------------------------- | ||
TOTAL 1985 499 75% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
|
||
|
||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
|
||
|
||
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" /> | ||
<title>Coverage for config.py: 100%</title> | ||
<link rel="stylesheet" href="style.css" type="text/css"> | ||
|
||
<script type="text/javascript" src="jquery.min.js"></script> | ||
<script type="text/javascript" src="jquery.hotkeys.js"></script> | ||
<script type="text/javascript" src="jquery.isonscreen.js"></script> | ||
<script type="text/javascript" src="coverage_html.js"></script> | ||
<script type="text/javascript"> | ||
jQuery(document).ready(coverage.pyfile_ready); | ||
</script> | ||
</head> | ||
<body class="pyfile"> | ||
|
||
<div id="header"> | ||
<div class="content"> | ||
<h1>Coverage for <b>config.py</b> : | ||
<span class="pc_cov">100%</span> | ||
</h1> | ||
|
||
<img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" /> | ||
|
||
<h2 class="stats"> | ||
6 statements | ||
<span class="run hide_run shortkey_r button_toggle_run">6 run</span> | ||
<span class="mis shortkey_m button_toggle_mis">0 missing</span> | ||
<span class="exc shortkey_x button_toggle_exc">0 excluded</span> | ||
|
||
|
||
</h2> | ||
</div> | ||
</div> | ||
|
||
<div class="help_panel"> | ||
<img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" /> | ||
<p class="legend">Hot-keys on this page</p> | ||
<div> | ||
<p class="keyhelp"> | ||
<span class="key">r</span> | ||
<span class="key">m</span> | ||
<span class="key">x</span> | ||
<span class="key">p</span> toggle line displays | ||
</p> | ||
<p class="keyhelp"> | ||
<span class="key">j</span> | ||
<span class="key">k</span> next/prev highlighted chunk | ||
</p> | ||
<p class="keyhelp"> | ||
<span class="key">0</span> (zero) top of page | ||
</p> | ||
<p class="keyhelp"> | ||
<span class="key">1</span> (one) first highlighted chunk | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div id="source"> | ||
<table> | ||
<tr> | ||
<td class="linenos"> | ||
<p id="n1" class="stm run hide_run"><a href="#n1">1</a></p> | ||
<p id="n2" class="stm run hide_run"><a href="#n2">2</a></p> | ||
<p id="n3" class="stm run hide_run"><a href="#n3">3</a></p> | ||
<p id="n4" class="stm run hide_run"><a href="#n4">4</a></p> | ||
<p id="n5" class="stm run hide_run"><a href="#n5">5</a></p> | ||
<p id="n6" class="stm run hide_run"><a href="#n6">6</a></p> | ||
|
||
</td> | ||
<td class="text"> | ||
<p id="t1" class="stm run hide_run"><span class="nam">cognito_userpool_id</span> <span class="op">=</span> <span class="str">'us-east-1_sKC0FXdYE'</span><span class="strut"> </span></p> | ||
<p id="t2" class="stm run hide_run"><span class="nam">cognito_app_client_id</span> <span class="op">=</span> <span class="str">'6h52ib9acta6l7kpv7oja879eg'</span><span class="strut"> </span></p> | ||
<p id="t3" class="stm run hide_run"><span class="nam">database_user_name</span> <span class="op">=</span> <span class="str">'HooliASE'</span><span class="strut"> </span></p> | ||
<p id="t4" class="stm run hide_run"><span class="nam">database_endpoint</span> <span class="op">=</span> <span class="str">'minghaoli995.cfyz5fmpzjzj.ap-south-1.rds.amazonaws.com'</span><span class="strut"> </span></p> | ||
<p id="t5" class="stm run hide_run"><span class="nam">port</span> <span class="op">=</span> <span class="num">3306</span><span class="strut"> </span></p> | ||
<p id="t6" class="stm run hide_run"><span class="nam">database_pwd</span> <span class="op">=</span> <span class="str">'Sumcyq-9cogdy-vymfuw'</span><span class="strut"> </span></p> | ||
|
||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<div id="footer"> | ||
<div class="content"> | ||
<p> | ||
<a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io">coverage.py v4.5.2</a>, | ||
created at 2018-12-14 15:28 | ||
</p> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.