Giter VIP home page Giter VIP logo

french-wiki-2500-pretrained-sentencepiece-lm's Introduction

French-Wiki-2500-Pretrained-SentencePiece-LM

I created this French SentencePiece Language Model, by using french Wikipedia articles that had more than 2500 words. The model is an AWD_LSTM, and it was trined for around 14 hours on a GCP using a v100 instance. If your goal is to create a language model more training would be necessary, and most likely a different architecture, but if you are using it as part of a classification task, you can fine-tune this model with your data set.

If you would like to download the pretrained french language model is is available in my google drive.

Inside you will find several different files:

  • fr_spm.ipynb - notebook I used to create the language spm model
  • learner_fr_spm_enc.pth - encoder
  • learner_mod_fr_spm.pkl - language model learner
  • learner_mod_fr_spm_export.pkl - language model learner(using export)
  • learner_mod_fr_spm_save.pkl.pth - language model learner(using save)
  • learner_vocab_fr_spm.pkl - language model vocab
  • spm.model - Sentence Piece model(spm)
  • spm.vocab - Sentence Piece vocabulary

If you would like to use these models, I would recommend that you check out the amazing Fast.ai NLP course, github page, and the associated turkish/spm notebook

If you are following along with the nn-turkish.ipynb notebook, you will need to create a folder called tmp and put spm.model and spm.vocab inside of that tmp folder and In the step where you are creating a finetuned language model:

data_lm = (TextList.from_df(df, path_clas, cols='text', processor=SPProcessor.load(dest))
    .split_by_rand_pct(0.1, seed=42)
    .label_for_lm()           
    .databunch(bs=bs, num_workers=1))

data_lm.save(f'{lang}_clas_databunch')

You are going to define dest as the location where you put the tmp folder.

If you are using .save, you can add an optional argument return_path=True so you can know where everything is being stored, since I found that it is not always abundantly clear.

french-wiki-2500-pretrained-sentencepiece-lm's People

Contributors

danacity avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

piegu ismailfatih

french-wiki-2500-pretrained-sentencepiece-lm's Issues

Quick citation

Hey,

Thanks again for making your work available. Do you have a citation for the following quote?

Based on the research from fast.ai a more accurate language model doesn't necessarily mean you will have a better classifier, and often the opposite is true.

I've heard it referenced in the lectures, but haven't been able to find the source.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.