-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhuoyuan yao
committed
Feb 21, 2020
1 parent
8912649
commit f7bc3d0
Showing
3 changed files
with
54 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# 第七章作业 | ||
请查看实验指导书了解实验内容 | ||
# 第七章作业 | ||
# 说明 | ||
请根据"实验指导书.pdf":part2.2和part4分别完场N-gram计数和Witten-Bell算法的编写。 | ||
|
||
编译文件:Makefile | ||
|
||
# 提供的C++文件介绍: | ||
1. main.C:入口函数 | ||
2. util.{H,C}:提供命令行解析,读取和写出数据等功能,不必仔细阅读,可以掠过。 | ||
3. lang_model.{H,C}:LM类定义,本实验主要部分内容,需要完成.C文件中count_sentence_ngrams()和get_prob_witten_bell()函数。 | ||
4. lab3_lm.{H,C}:语言模型实验的wrapper函数。 | ||
|
||
# 数据文件: | ||
字典:lab3.syms | ||
训练集:minitrain.txt和minitrain2.txt | ||
测试集:test1.txt和test2.txt | ||
|
||
# bash文件: | ||
lab3_p1{a,b}.sh:测试N-gram计数 | ||
lab3_p3 {a,b}.sh:测试Witten-Bell smoothing算法 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -e | ||
|
||
|
||
if [[ -e ./lab3_lm ]] ; then | ||
binStr="./lab3_lm" | ||
elif [[ -e Lab3Lm.class ]] ; then | ||
binStr="java Lab3Lm" | ||
else | ||
echo "Couldn't find program to execute." | ||
exit 1 | ||
fi | ||
|
||
|
||
$binStr --vocab lab3.syms --train minitrain2.txt --test test1.txt \ | ||
--count_file p1a.counts | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -e | ||
|
||
|
||
if [[ -e ./lab3_lm ]] ; then | ||
binStr="./lab3_lm" | ||
elif [[ -e Lab3Lm.class ]] ; then | ||
binStr="java Lab3Lm" | ||
else | ||
echo "Couldn't find program to execute." | ||
exit 1 | ||
fi | ||
|
||
|
||
$binStr --vocab lab3.syms --train minitrain.txt --test test1.txt \ | ||
--count_file p1b.counts | ||
|
||
|