Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
leezu committed Jun 4, 2019
1 parent 12a0943 commit 501189c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@

import sys
import os
# import os.path
import argparse
import numpy as np
import mxnet as mx
import gluonnlp as nlp

sys.path.insert(0, os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)))
from utils import tf_vocab_to_gluon_vocab

parser = argparse.ArgumentParser(description='Comparison script for BERT model in Tensorflow'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,18 @@
import json
import logging
import os
import sys

import mxnet as mx

from gluonnlp.model import BERTEncoder, BERTModel
from gluonnlp.model.bert import bert_hparams
from utils import load_tf_vocab, tf_vocab_to_gluon_vocab, get_hash, read_tf_checkpoint

sys.path.insert(0, os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)))

from utils import (get_hash, load_tf_vocab, read_tf_checkpoint,
tf_vocab_to_gluon_vocab)


parser = argparse.ArgumentParser(
description='Conversion script for Tensorflow BERT model',
Expand Down
2 changes: 1 addition & 1 deletion scripts/bert/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ Command line interface

.. code-block:: shell
python bert/bert.py --sentences "GluonNLP is a toolkit that enables easy text preprocessing, datasets loading and neural models building to help you speed up your Natural Language Processing (NLP) research."
python bert/embedding.py --sentences "GluonNLP is a toolkit that enables easy text preprocessing, datasets loading and neural models building to help you speed up your Natural Language Processing (NLP) research."
Text: GluonNLP is a toolkit that enables easy text preprocessing, datasets loading and neural models building to help you speed up your Natural Language Processing (NLP) research.
Tokens embedding: [array([-0.11881411, -0.59530115, 0.627092 , ..., 0.00648153,
-0.03886228, 0.03406909], dtype=float32), array([-0.7995638 , -0.6540758 , -0.00521846, ..., -0.42272145,
Expand Down

0 comments on commit 501189c

Please sign in to comment.