Skip to content

Commit 0910004

Browse files
committed
Merge branch '0.4.3'
2 parents 8de223b + e877b28 commit 0910004

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "JudiLing"
22
uuid = "b43a184b-0e9d-488b-813a-80fd5dbc9fd8"
33
authors = ["Xuefeng Luo"]
4-
version = "0.4.2"
4+
version = "0.4.3"
55

66
[deps]
77
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"

src/JudiLing.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ include("output.jl")
2424
include("preprocess.jl")
2525
include("pickle.jl")
2626
include("test_combo.jl")
27+
include("display.jl")
2728

2829
end

src/display.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function display_SC(M, rownames, colnames; nrow=6, ncol=6)
2+
M_part = M[1:nrow, 1:ncol]
3+
rownames_part = rownames[1:nrow]
4+
colnames_part = colnames[1:ncol]
5+
6+
df = DataFrame()
7+
df["Data"] = rownames_part
8+
for (i,coln) in enumerate(colnames_part)
9+
df[coln] = M_part[:,i]
10+
end
11+
12+
display(df)
13+
end

src/find_path.jl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,53 @@ struct Gold_Path_Info_Struct
1818
support::Float64
1919
end
2020

21+
function learn_paths(
22+
data,
23+
cue_obj,
24+
S_val,
25+
F_train,
26+
Chat_val;
27+
threshold = 0.1,
28+
is_tolerant = false,
29+
tolerance = (-1000.0),
30+
max_tolerance = 3,
31+
grams = 3,
32+
tokenized = true,
33+
sep_token = "_",
34+
keep_sep = true,
35+
target_col = :Verb_syll,
36+
verbose = true)
37+
38+
max_t = JudiLing.cal_max_timestep(data, target_col)
39+
40+
learn_paths(
41+
data,
42+
data,
43+
cue_obj.C,
44+
S_val,
45+
F_train,
46+
Chat_val,
47+
cue_obj.A,
48+
cue_obj.i2f,
49+
cue_obj.f2i;
50+
gold_ind = nothing,
51+
Shat_val = nothing,
52+
check_gold_path = false,
53+
max_t = max_t,
54+
max_can = 10,
55+
threshold = threshold,
56+
is_tolerant = is_tolerant,
57+
tolerance = tolerance,
58+
max_tolerance = max_tolerance,
59+
grams = grams,
60+
tokenized = tokenized,
61+
sep_token = sep_token,
62+
keep_sep = keep_sep,
63+
target_col = target_col,
64+
verbose = verbose,
65+
)
66+
end
67+
2168
"""
2269
learn_paths(data_train, data_val, C_train, S_val, F_train, Chat_val, A, i2f, f2i)
2370

0 commit comments

Comments
 (0)