Skip to content

Commit 7ae7548

Browse files
committed
change variable names function names
1 parent 1204d6e commit 7ae7548

14 files changed

+118
-118
lines changed

docs/src/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ We use letter n-grams to encode our forms. For word `vocoo`, for example, we enc
5353
cue_obj_train = JudiLing.make_cue_matrix(
5454
latin_train,
5555
grams=3,
56-
words_column=:Word,
56+
target_col=:Word,
5757
tokenized=false,
5858
keep_sep=false
5959
)
@@ -66,7 +66,7 @@ cue_obj_val = JudiLing.make_cue_matrix(
6666
latin_val,
6767
cue_obj_train,
6868
grams=3,
69-
words_column=:Word,
69+
target_col=:Word,
7070
tokenized=false,
7171
keep_sep=false
7272
)
@@ -127,7 +127,7 @@ max_t = JudiLing.cal_max_timestep(latin_train, latin_val, :Word)
127127

128128
Finally, we make to our path finding function to predict forms in a sequence.
129129
```julia
130-
res_train, gpi_train = JudiLing.shuo(
130+
res_train, gpi_train = JudiLing.learn_paths(
131131
latin_train,
132132
latin_train,
133133
cue_obj_train.C,
@@ -146,11 +146,11 @@ res_train, gpi_train = JudiLing.shuo(
146146
tokenized=false,
147147
sep_token="_",
148148
keep_sep=false,
149-
words_column=:Word,
149+
target_col=:Word,
150150
issparse=:dense,
151151
verbose=true)
152152

153-
res_val, gpi_val = JudiLing.shuo(
153+
res_val, gpi_val = JudiLing.learn_paths(
154154
latin_train,
155155
latin_val,
156156
cue_obj_train.C,
@@ -172,7 +172,7 @@ res_val, gpi_val = JudiLing.shuo(
172172
tokenized=false,
173173
sep_token="-",
174174
keep_sep=false,
175-
words_column=:Word,
175+
target_col=:Word,
176176
issparse=:dense,
177177
verbose=true)
178178
```

docs/src/man/find_path.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ CurrentModule = JudiLing
77
```@docs
88
Result_Path_Info_Struct
99
Gold_Path_Info_Struct
10-
shuo
11-
hua
12-
shuo(::DataFrame,::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict)
13-
hua(::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict,::Array)
10+
learn_paths
11+
build_paths
12+
learn_paths(::DataFrame,::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict)
13+
build_paths(::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict,::Array)
1414
eval_can(::Vector{Vector{Tuple{Vector{Integer}, Integer}}},::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Dict,::Integer,::Bool)
1515
find_top_feature_indices(::Matrix, ::Array)
1616
```

examples/latin.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ latin_val = latin_train[101:150,:]
1111
cue_obj_train = JudiLing.make_cue_matrix(
1212
latin_train,
1313
grams=3,
14-
words_column=:Word,
14+
target_col=:Word,
1515
tokenized=false,
1616
keep_sep=false
1717
)
1818
cue_obj_val = JudiLing.make_cue_matrix(
1919
latin_val,
2020
cue_obj_train,
2121
grams=3,
22-
words_column=:Word,
22+
target_col=:Word,
2323
tokenized=false,
2424
keep_sep=false
2525
)
@@ -57,11 +57,11 @@ Shat_val = cue_obj_val.C * F_train
5757
# here we only use a adjacency matrix as we got it from training dataset
5858
A = cue_obj_train.A
5959

60-
# we calculate how many timestep we need for shuo and huo function
60+
# we calculate how many timestep we need for learn_paths and huo function
6161
max_t = JudiLing.cal_max_timestep(latin_train, latin_val, :Word)
6262

63-
# we calculate shuo and hua function
64-
res_train, gpi_train = JudiLing.shuo(
63+
# we calculate learn_paths and hua function
64+
res_train, gpi_train = JudiLing.learn_paths(
6565
latin_train,
6666
latin_train,
6767
cue_obj_train.C,
@@ -80,11 +80,11 @@ res_train, gpi_train = JudiLing.shuo(
8080
tokenized=false,
8181
sep_token="_",
8282
keep_sep=false,
83-
words_column=:Word,
83+
target_col=:Word,
8484
issparse=:dense,
8585
verbose=true)
8686

87-
res_val, gpi_val = JudiLing.shuo(
87+
res_val, gpi_val = JudiLing.learn_paths(
8888
latin_train,
8989
latin_val,
9090
cue_obj_train.C,
@@ -106,7 +106,7 @@ res_val, gpi_val = JudiLing.shuo(
106106
tokenized=false,
107107
sep_token="-",
108108
keep_sep=false,
109-
words_column=:Word,
109+
target_col=:Word,
110110
issparse=:dense,
111111
verbose=true)
112112

src/cholesky.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
the first part of make transform matrix, usually in the shuo function to same
2+
the first part of make transform matrix, usually in the learn_paths function to same
33
time and computing resources
44
"""
55
function make_transform_fac end

src/eval.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ end
6969
"""
7070
eval_acc(::Array, ::Array)
7171
72-
Evaluate the outputs from shuo function or hua function
72+
Evaluate the outputs from learn_paths function or build_paths function
7373
7474
...
7575
# Arguments
7676
- `verbose::Bool=false`: if verbose, more information prints out
7777
7878
# Examples
7979
```julia
80-
#after you had results from shuo or hua
80+
#after you had results from learn_paths or build_paths
8181
acc_train = JudiLing.eval_acc(
8282
res_train,
8383
cue_obj_train.gold_ind,
@@ -115,7 +115,7 @@ end
115115
"""
116116
eval_acc_loose(::Array, ::Array)
117117
118-
Evaluate the outputs from shuo function or hua function, if one of the candidates
118+
Evaluate the outputs from learn_paths function or build_paths function, if one of the candidates
119119
are correct, then we take it correct. This reflects how many paths we could found
120120
but we could not recogni
121121
@@ -125,7 +125,7 @@ but we could not recogni
125125
126126
# Examples
127127
```julia
128-
#after you had results from shuo or hua
128+
#after you had results from learn_paths or build_paths
129129
acc_train_loose = JudiLing.eval_acc_loose(
130130
res_train,
131131
cue_obj_train.gold_ind,

src/find_path.jl

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
store paths information found by shuo or hua function
2+
store paths information found by learn_paths or build_paths function
33
"""
44
struct Result_Path_Info_Struct
55
ngrams_ind::Array
@@ -18,20 +18,20 @@ struct Gold_Path_Info_Struct
1818
end
1919

2020
"""
21-
shuo function takes each timestep individually and calculate Yt_hat respectively,
21+
learn_paths function takes each timestep individually and calculate Yt_hat respectively,
2222
"""
23-
function shuo end
23+
function learn_paths end
2424

2525
"""
26-
hua function is shortcut algorithms that only takes n-grams that closed to the
26+
build_paths function is shortcut algorithms that only takes n-grams that closed to the
2727
validation data
2828
"""
29-
function hua end
29+
function build_paths end
3030

3131
"""
32-
shuo(::DataFrame,::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict)
32+
learn_paths(::DataFrame,::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict)
3333
34-
shuo function takes each timestep individually and calculate Yt_hat respectively,
34+
learn_paths function takes each timestep individually and calculate Yt_hat respectively,
3535
3636
...
3737
# Arguments
@@ -48,7 +48,7 @@ shuo function takes each timestep individually and calculate Yt_hat respectively
4848
- `tokenized::Bool=false`: whether tokenized
4949
- `sep_token::Union{Nothing, String, Char}=nothing`: seperate token
5050
- `keep_sep::Bool=false`: whether keep seperaters in grams
51-
- `words_column::Union{String, :Symbol}=:Words`: word column names
51+
- `target_col::Union{String, :Symbol}=:Words`: word column names
5252
- `issparse::Symbol=:auto`: mt matrix output format mode
5353
- `verbose::Bool=false`: if verbose, more information will be printed out
5454
@@ -58,7 +58,7 @@ latin_train = CSV.DataFrame!(CSV.File(joinpath("data", "latin_mini.csv")))
5858
cue_obj_train = JudiLing.make_cue_matrix(
5959
latin_train,
6060
grams=3,
61-
words_column=:Word,
61+
target_col=:Word,
6262
tokenized=false,
6363
keep_sep=false
6464
)
@@ -68,7 +68,7 @@ cue_obj_val = JudiLing.make_cue_matrix(
6868
latin_val,
6969
cue_obj_train,
7070
grams=3,
71-
words_column=:Word,
71+
target_col=:Word,
7272
tokenized=false,
7373
keep_sep=false
7474
)
@@ -96,7 +96,7 @@ A = cue_obj_train.A
9696
9797
max_t = JudiLing.cal_max_timestep(latin_train, latin_val, :Word)
9898
99-
res_train, gpi_train = JudiLing.shuo(
99+
res_train, gpi_train = JudiLing.learn_paths(
100100
latin_train,
101101
latin_train,
102102
cue_obj_train.C,
@@ -115,11 +115,11 @@ res_train, gpi_train = JudiLing.shuo(
115115
tokenized=false,
116116
sep_token="_",
117117
keep_sep=false,
118-
words_column=:Word,
118+
target_col=:Word,
119119
issparse=:dense,
120120
verbose=false)
121121
122-
res_val, gpi_val = JudiLing.shuo(
122+
res_val, gpi_val = JudiLing.learn_paths(
123123
latin_train,
124124
latin_val,
125125
cue_obj_train.C,
@@ -141,13 +141,13 @@ res_val, gpi_val = JudiLing.shuo(
141141
tokenized=false,
142142
sep_token="-",
143143
keep_sep=false,
144-
words_column=:Word,
144+
target_col=:Word,
145145
issparse=:dense,
146146
verbose=false)
147147
```
148148
...
149149
"""
150-
function shuo(
150+
function learn_paths(
151151
data_train::DataFrame,
152152
data_val::DataFrame,
153153
C_train::SparseMatrixCSC,
@@ -169,7 +169,7 @@ function shuo(
169169
tokenized=false::Bool,
170170
sep_token=nothing::Union{Nothing, String, Char},
171171
keep_sep=false::Bool,
172-
words_column="Words"::String,
172+
target_col="Words"::String,
173173
issparse=:auto::Symbol,
174174
verbose=false::Bool
175175
)::Union{Tuple{Vector{Vector{Result_Path_Info_Struct}}, Vector{Gold_Path_Info_Struct}}, Vector{Vector{Result_Path_Info_Struct}}}
@@ -206,7 +206,7 @@ function shuo(
206206
i,
207207
data_train,
208208
grams=grams,
209-
words_column=words_column,
209+
target_col=target_col,
210210
tokenized=tokenized,
211211
sep_token=sep_token,
212212
keep_sep=keep_sep)
@@ -342,21 +342,21 @@ function shuo(
342342
end
343343

344344
"""
345-
hua(::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict,::Array)
345+
build_paths(::DataFrame,::SparseMatrixCSC,::Union{SparseMatrixCSC, Matrix},::::Union{SparseMatrixCSC, Matrix},::Matrix,::SparseMatrixCSC,::Dict,::Array)
346346
347-
hua function is shortcut algorithms that only takes n-grams that closed to the
347+
build_paths function is shortcut algorithms that only takes n-grams that closed to the
348348
validation data
349349
350350
...
351351
# Arguments
352-
- `rC::Union{Nothing, Matrix}=nothing`: correlation between c and chat, passing to save computing time
352+
- `rC::Union{Nothing, Matrix}=nothing`: correlation Matrix of C and Chat, passing it to save computing time
353353
- `max_t::Integer=15`: maximum timestep
354354
- `max_can::Integer=10`: maximum candidates when output
355355
- `n_neighbors::Integer=10`: find indices only in top n neighbors
356356
- `grams::Integer=3`: n-grams
357357
- `tokenized::Bool=false`: whether tokenized
358358
- `sep_token::Union{Nothing, String, Char}=nothing`: seperate token
359-
- `words_column::Union{String, :Symbol}=:Words`: word column names
359+
- `target_col::Union{String, :Symbol}=:Words`: word column names
360360
- `verbose::Bool=false`: if verbose, more information will be printed out
361361
362362
# Examples
@@ -365,7 +365,7 @@ latin_train = CSV.DataFrame!(CSV.File(joinpath("data", "latin_mini.csv")))
365365
cue_obj_train = JudiLing.make_cue_matrix(
366366
latin_train,
367367
grams=3,
368-
words_column=:Word,
368+
target_col=:Word,
369369
tokenized=false,
370370
keep_sep=false
371371
)
@@ -375,7 +375,7 @@ cue_obj_val = JudiLing.make_cue_matrix(
375375
latin_val,
376376
cue_obj_train,
377377
grams=3,
378-
words_column=:Word,
378+
target_col=:Word,
379379
tokenized=false,
380380
keep_sep=false
381381
)
@@ -403,7 +403,7 @@ A = cue_obj_train.A
403403
404404
max_t = JudiLing.cal_max_timestep(latin_train, latin_val, :Word)
405405
406-
JudiLing.hua(
406+
JudiLing.build_paths(
407407
latin_train,
408408
cue_obj_train.C,
409409
S_train,
@@ -417,7 +417,7 @@ JudiLing.hua(
417417
verbose=false
418418
)
419419
420-
JudiLing.hua(
420+
JudiLing.build_paths(
421421
latin_val,
422422
cue_obj_train.C,
423423
S_val,
@@ -433,7 +433,7 @@ JudiLing.hua(
433433
```
434434
...
435435
"""
436-
function hua(
436+
function build_paths(
437437
data_val::DataFrame,
438438
C_train::SparseMatrixCSC,
439439
S_val::Union{SparseMatrixCSC, Matrix},
@@ -449,7 +449,7 @@ function hua(
449449
grams=3::Integer,
450450
tokenized=false::Bool,
451451
sep_token=nothing::Union{Nothing, String, Char},
452-
words_column=:Words::Union{String, Symbol},
452+
target_col=:Words::Union{String, Symbol},
453453
verbose=false::Bool
454454
)::Vector{Vector{Result_Path_Info_Struct}}
455455
# initialize queues for storing paths

0 commit comments

Comments
 (0)