Skip to content

Instantly share code, notes, and snippets.

View tejasvaidhyadev's full-sized avatar
🎯

Tejas Vaidhya tejasvaidhyadev

🎯
View GitHub Profile
@tejasvaidhyadev
tejasvaidhyadev / test.jl
Last active February 10, 2020 11:19
For testing Avg Perceptron POS present in julia TextAnalysis.jl
using CorpusLoaders
using TextAnalysis
using MultiResolutionIterators
test=load(CoNLL(),"test")
test=flatten_levels(test, lvls(CoNLL, :document)) |> full_consolidate
testx=Vector{String}()
testy=Vector{String}()
tagger =PerceptronTagger(true)
for val in 1:length(test)
@tejasvaidhyadev
tejasvaidhyadev / Sentencepiece_unigram.jl
Created June 26, 2020 06:58
Experimental Implementation of Sentencepiece in julia
function load(path)
vocab = readlines(path)
vocabnew = split.(vocab , "\t")
vo = []
for i in 1:30000
vocab1 = vocabnew[i][1]
vocab1 = replace(vocab1,""=>"_")
push!(vo,vocab1)
end
vocab1 = convert(Array{String,1},vo)
@tejasvaidhyadev
tejasvaidhyadev / tfcp2bson.jl
Last active August 13, 2020 10:24
tfcp2bson helps in converting checkpoints
using JSON
using ZipFile
using Flux: loadparams!
"""
tfckpt2bsonforalbert(path;
raw=false,
saveto="./",