Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexis Nasr
macaon2
Commits
bd658b7a
Commit
bd658b7a
authored
7 years ago
by
Alexis Nasr
Browse files
Options
Downloads
Patches
Plain Diff
modified word_embedding handling in cff2fann.c
parent
fa380ae0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
maca_common/include/word_emb.h
+8
-10
8 additions, 10 deletions
maca_common/include/word_emb.h
maca_trans_parser/src/cff2fann.c
+3
-1
3 additions, 1 deletion
maca_trans_parser/src/cff2fann.c
with
11 additions
and
11 deletions
maca_common/include/word_emb.h
+
8
−
10
View file @
bd658b7a
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
#define __WORD_EMB__
#define __WORD_EMB__
#include
"hash.h"
#include
"hash.h"
/* #include"fann.h"*/
#include
"dico.h"
#include
"dico.h"
typedef
struct
typedef
struct
...
@@ -14,21 +13,20 @@ typedef struct
...
@@ -14,21 +13,20 @@ typedef struct
}
word_emb
;
}
word_emb
;
word_emb
*
word_emb_new
(
int
dim
,
int
nbelem
);
word_emb
*
word_emb_new
(
int
dim
,
int
nbelem
);
void
word_emb_free
(
word_emb
*
we
);
void
word_emb_free
(
word_emb
*
we
);
word_emb
*
word_emb_load
(
char
*
filename
);
word_emb
*
word_emb_load
(
char
*
filename
);
float
*
word_emb_get_vector
(
word_emb
*
we
,
char
*
word
);
float
*
word_emb_get_vector
(
word_emb
*
we
,
char
*
word
);
int
word_emb_get_code
(
word_emb
*
we
,
char
*
word
);
int
word_emb_get_code
(
word_emb
*
we
,
char
*
word
);
/* int word_emb_fill_input_array_dnn(fann_type *input_array, word_emb *we, int code, int first_index); */
int
word_emb_fill_input_array_dnn
(
float
*
input_array
,
word_emb
*
we
,
int
code
,
int
first_index
);
int
word_emb_fill_input_array_dnn
(
float
*
input_array
,
word_emb
*
we
,
int
code
,
int
first_index
);
void
word_emb_print
(
FILE
*
f
,
word_emb
*
we
,
int
code
);
void
word_emb_print
(
FILE
*
f
,
word_emb
*
we
,
int
code
);
int
word_emb_number_of_lines_in_file
(
char
*
filename
);
int
word_emb_number_of_lines_in_file
(
char
*
filename
);
int
word_emb_number_of_columns_in_file
(
char
*
filename
);
int
word_emb_number_of_columns_in_file
(
char
*
filename
);
word_emb
*
word_emb_load_w2v_file
(
char
*
filename
);
word_emb
*
word_emb_load_w2v_file
(
char
*
filename
);
word_emb
*
word_emb_load_w2v_file_filtered
(
char
*
file_name
,
dico
*
d
);
word_emb
*
word_emb_load_w2v_file_filtered
(
char
*
file_name
,
dico
*
d
);
void
word_emb_print_to_file
(
word_emb
*
we
,
char
*
filename
);
void
word_emb_print_to_file
(
word_emb
*
we
,
char
*
filename
);
#endif
#endif
This diff is collapsed.
Click to expand it.
maca_trans_parser/src/cff2fann.c
+
3
−
1
View file @
bd658b7a
...
@@ -158,7 +158,9 @@ void cff2fann(context *ctx)
...
@@ -158,7 +158,9 @@ void cff2fann(context *ctx)
/* printf("representation = %d\n", m->representation[mcd_col]); */
/* printf("representation = %d\n", m->representation[mcd_col]); */
if
(
m
->
representation
[
mcd_col
]
==
MCD_REPRESENTATION_EMB
){
if
(
m
->
representation
[
mcd_col
]
==
MCD_REPRESENTATION_EMB
){
/* printf("it is an embedding val = %d, file = %s\n", val, m->filename[mcd_col]); */
fprintf
(
stderr
,
"it is an embedding val = %d, file = %s
\n
"
,
feature_valindex
,
m
->
filename
[
mcd_col
]);
//int word_emb_get_code(word_emb *we, char *word)
/* word_emb_print(stdout, m->word_emb_array[mcd_col], feature_valindex); */
/* word_emb_print(stdout, m->word_emb_array[mcd_col], feature_valindex); */
/* printf("\n"); */
/* printf("\n"); */
printf
(
"
\t
%d"
,
feature_valindex
);
printf
(
"
\t
%d"
,
feature_valindex
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment