Skip to content

Adding Glove and Tensorflow compatibility#22

Open
kris927b wants to merge 3 commits intobplank:masterfrom
kris927b:master
Open

Adding Glove and Tensorflow compatibility#22
kris927b wants to merge 3 commits intobplank:masterfrom
kris927b:master

Conversation

@kris927b
Copy link

I added two things to the embeds folder:

  1. Glove compatibility
  2. Made it possible to open a local pre-trained transformer

Glove Compatibility

Following the format of poly.py, we can now load different versions of the Glove embeddings and add them to the CONLL files. It uses the embeddings library to load the Glove embeddings. You can get all four kinds of embeddings using one of these tags:

  • common_crawl_48
  • common_crawl_840
  • twitter
  • wikipedia_gigaword

Local Transformer

Using the huggingface transformers library we are also able to open custom transformers we have saved locally. These should be in the TensorFlow checkpoint format. In regards to this, I also updated the readme to show users how to do this, since this can be a little tricky.

Similarly you can use one of your own pretrained transformer models in a tensorflow format using the following commands:

python3 embeds/transf.py data/da-ud-train.conllu embeds/bert.ckpt-xxxx.index embeds/vocab.txt >embeds/bert_config.json
python3 embeds/transf.py data/da-ud-dev.conllu embeds/bert.ckpt-xxxx.index embeds/vocab.txt embeds/bert_config.json
python3 embeds/transf.py data/da-ud-test.conllu embeds/bert.ckpt-xxxx.index embeds/vocab.txt embeds/bert_config.json

If the folder containing the .index and the vocab contains a file named config.json you can leave out the last argument in the above commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant