Skip to content

Commit d0f1c69

Browse files
committed
Fix bug.
1 parent 105f5e2 commit d0f1c69

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ string similarity search.
1515
python main.py --dataset word --nt 1000 --nq 1000 --epochs 20 --save-split --recall
1616
```
1717

18-
- set epoch as 0 to test bert embedding
18+
- test bert embedding
1919
```
20-
python main.py --dataset word --nt 1000 --nq 1000 --epochs 0 --save-split --recall
20+
python main.py --dataset word --nt 1000 --nq 1000 --bert --save-split --recall
2121
```
2222

2323
##### optional arguments:

embed_cnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def cnn_embedding(args, h, data_file):
6868

6969
# check if we use bert here
7070
char_alphabet = None
71-
if args.epochs == 0:
71+
if args.bert:
7272
char_alphabet = h.alphabet
7373

7474
xt = _batch_embed(args, model.embedding_net, h.xt, device, char_alphabet=char_alphabet)

main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def get_args():
227227
parser.add_argument(
228228
"--recall", action="store_true", default=False, help="print recall"
229229
)
230+
parser.add_argument(
231+
"--bert", action="store_true", default=False, help="using bert or not"
232+
)
230233
parser.add_argument("--embed", type=str, default="cnn", help="embedding method")
231234
parser.add_argument("--maxl", type=int, default=0, help="max length of strings")
232235
parser.add_argument(

0 commit comments

Comments
 (0)