Skip to content

Commit

Permalink
new load
Browse files Browse the repository at this point in the history
  • Loading branch information
EC2 Default User committed Nov 5, 2019
1 parent 6ee43a6 commit 222bc4e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,24 @@ Detailed information about experiments can be found in [scripts/](scripts/README
**Note**: An Nvidia GPU is required to train the models in a reasonable amount of time.

## Tagging
Available Pre-Trained Models

Note: Limited Support
```JULIA
trained(MorseModel, TRDataSet);
trained(MorseModel, UDDataSet, lang="ru");
trained(MorseModel, UDDataSet, lang="da");
trained(MorseModel, UDDataSet, lang="fi");
trained(MorseModel, UDDataSet, lang="pt");
trained(MorseModel, UDDataSet, lang="es");
trained(MorseModel, UDDataSet, lang="hu");
trained(MorseModel, UDDataSet, lang="bg");
trained(MorseModel, UDDataSet, lang="sv");
```
How To Use

```Julia
julia> using Knet, KnetLayers, Morse
julia> model, vocabulary, parser = trained(MorseModel, TRDataSet, vers="2018");
julia> model, vocabulary, parser = trained(MorseModel, TRDataSet);
julia> predictions = model("annem sana yardım edemez .", v=vocabulary, p=parser)
annem anne+Noun+A3sg+P1sg+Nom
sana sen+Pron+Pers+A2sg+Pnon+Dat
Expand Down
6 changes: 3 additions & 3 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ function download(dataset::Type{TRDataSet}; path=dir("data","TrMor2018"))
end
end

const server_url ="ai.ku.edu.tr/models/morse/"
const server_url ="people.csail.mit.edu/deniz/models/morse/"

function download(model::Type{T}, format::Type{TRDataSet}; vers="2018", lemma=true, lang="tr") where T
function download(model::Type{T}, format; vers="2018", lemma=true, lang="tr") where T
flang = format===TRDataSet ? string("TR-tr",vers) : string("UD-",lang)
mname = string(T,"_lemma_",lemma,"_lang_",flang,"_size_full",".jld2")
mname = string("bestModel.",T,"_lemma_",lemma,"_lang_",flang,"_size_full","_params.jld2")
lpath = dir("checkpoints",mname)
if !isfile(lpath)
mpath = string(server_url, mname)
Expand Down

0 comments on commit 222bc4e

Please sign in to comment.