-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
Great work! This is awesome. |
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/README.md
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/README.md
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertQA.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertQA.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertQA.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertQA.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertUtil.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertUtil.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertUtil.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor comments, otherwise this is good!
...ckage/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertDataParser.java
Show resolved
Hide resolved
...ckage/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertDataParser.java
Outdated
Show resolved
Hide resolved
...ckage/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertDataParser.java
Outdated
Show resolved
Hide resolved
...ckage/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertDataParser.java
Outdated
Show resolved
Hide resolved
...ckage/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/BertDataParser.java
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/README.md
Outdated
Show resolved
Hide resolved
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/README.md
Outdated
Show resolved
Hide resolved
By default, this model are using `bert_12_768_12` model with extra layers for QA jobs. | ||
|
||
After that, to be able to use it in Java, we need to export the dictionary from the script to parse the text | ||
to actual indexes. Please add the following lines after [this line](https://github.com/dmlc/gluon-nlp/blob/master/scripts/bert/staticbert/static_finetune_squad.py#L262). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dangerous... if that file changes, this link goes bad... another way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently no, since they did not provide vocabulary extraction
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok what if you quote the line - that way if it moves a bit, people still know where to work.
scala-package/examples/src/main/java/org/apache/mxnetexamples/javaapi/infer/bert/README.md
Outdated
Show resolved
Hide resolved
...examples/src/test/java/org/apache/mxnetexamples/javaapi/infer/predictor/BertExampleTest.java
Show resolved
Hide resolved
@aaronmarkham @piyushghai @zachgk Could you please double check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Content LGTM!
BertQA inst = new BertQA(); | ||
CmdLineParser parser = new CmdLineParser(inst); | ||
parser.parseArgument(args); | ||
BertDataParser util = new BertDataParser(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : util --> dataparser
just a more meaningful variable name :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment and then we're good to go :)
* add BertQA major code piece * add scripts and bug fixes * add integration test * address comments * address doc comments
* add BertQA major code piece * add scripts and bug fixes * add integration test * address comments * address doc comments
Description
As title explained, this example shows how Scala/Java can do the inference with BERT model.
@zachgk @andrewfayres @gigasquid @aaronmarkham
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.