PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
Planning | 计划 | 30 | 25 |
? Estimate | ? 估计这个任务需要多少时间 | 30 | 25 |
Development | 开发 | 480 | 600 |
? Analysis | ? 需求分析 (包括学习新技术) | 60 | 120 |
? Design Spec | ? 生成设计文档 | 35 | 30 |
? Design Review | ? 设计复审 | 20 | 20 |
? Coding Standard | ? 代码规范 (为目前的开发制定合适的规范) | 20 | 25 |
? Design | ? 具体设计 | 120 | 150 |
? Coding | ? 具体编码 | 120 | 120 |
? Code Review | ? 代码复审 | 120 | 150 |
? Test | ? 测试(自我测试,修改代码,提交修改) | 60 | 120 |
Reporting | 报告 | 90 | 120 |
? Test Repor | ? 测试报告 | 30 | 45 |
? Size Measurement | ? 计算工作量 | 10 | 15 |
? Postmortem & Process Improvement Plan | ? 事后总结, 并提出过程改进计划 | 30 | 35 |
合计 | 1225 | 1600 |
设计的创意独到之处
实现思路
实现成果展示
void File::del(char *argv[])
{
for (int i = 1; argv[i] != NULL; i = i + 2)
{
//遇到-i参数时,读入读取文件地址
if (strcmp(argv[i],"-i") == 0) {
input = argv[i + 1];
continue;
}
//遇到-o参数时,读入写入文件地址
else if (strcmp(argv[i], "-o") == 0) {
output = argv[i + 1];
continue;
}
//遇到-w参数时,判断权重
else if (strcmp(argv[i], "-w") == 0) {
fcountquz = atoi(argv[i + 1]);
//cout << countquz << "aaa" << endl;
}
//遇到-m参数时,得到词组大小
else if (strcmp(argv[i], "-m") == 0) {
fcountphrase = atoi(argv[i + 1]);
//cout << countphrase << "bbb" << endl;
}
//遇到-n参数时,得到输出前n个词组
else if (strcmp(argv[i], "-n") == 0) {
fouttop = atoi(argv[i + 1]);
//cout << outtop << "ccc" << endl;
}
}
return;
}
本次代码是在原有的WordCount的基础上对代码进行改进,在对命令行参数进行解析时,我主要是用一个循环匹配命令行标志位,之后用atoi函数获得对应参数;在单词/词组的存储上,我还是使用unordered_map进行存储,在词组判断方面我主要是用双向队列deque存储每个单词的起始位置,当队列当中存储的标志位达到上限时,输出标志位,截取字符串,这样做法的好处在于无论是单个的单词,还是一个词组,这样都可以使用,原本我打算用指针对单词标识位进行存储,后面发现链表查找效率太低,所以用了deque。暂时没有更好的思路了。
0
Title: Embodied Question Answering
Abstract: We present a new AI task -- Embodied Question Answering (EmbodiedQA) -- where an agent is spawned at a random location in a 3D environment and asked a question ("What color is the car?"). In order to answer, the agent must first intelligently navigate to explore the environment, gather necessary visual information through first-person (egocentric) vision, and then answer the question ("orange"). EmbodiedQA requires a range of AI skills -- language understanding, visual recognition, active perception, goal-driven navigation, commonsense reasoning, long-term memory, and grounding language into actions. In this work, we develop a dataset of questions and answers in House3D environments, evaluation metrics, and a hierarchical model trained with imitation and reinforcement learning.
characters: 817
words: 80
lines: 2
<embodied question answering>: 11
<active perception, goal>: 1
<agent must first>: 1
<answering (embodiedqa) -- where>: 1
<commonsense reasoning, long>: 1
<driven navigation, commonsense>: 1
<environment, gather necessary>: 1
<environments, evaluation metrics>: 1
<first intelligently navigate>: 1
<first-person (egocentric>: 1
本次性能分析测试主要使用从CVPR2018官网爬取的979篇文章的标题和摘要来进行测试,性能分析图如下:
代码覆盖率达到了90%,没有更高的原因在于代码中有写入对文件的异常处理如下
TEST_CLASS(EmptyTest)
{
public:
TEST_METHOD(TestMethod1)
{
//空白文本
File f;
Word w;
f.Filein();
int num = w.Countcharacters(f.fin);
int num1 = w.Countlines(f.fin);
int num2 = w.Countwords(f.fin);
Assert::IsTrue( (num==0) &&(num1==0) && (num2== 0) );
// TODO: 在此输入测试代码
}
};
TEST_CLASS(UnexistTest)
{
public:
TEST_METHOD(TestMethod1)
{
//错误文本
File f;
Word w;
f.input = "./unexist.txt";
int num=f.Filein();
Assert::IsTrue(num == 1);
// TODO: 在此输入测试代码
}
};
3.测试只含Title的输入文本(返回行数为1行,测试函数Countcharacters、Countlines、Countwords)
4.测试只含Abstract的文本输入(返回行数为1行,测试函数Countcharacters、Countlines、Countwords)
5.测试纯数字样本(返回字符数应该为0,测试函数Countwords)
TEST_CLASS(NumTest)
{
public:
TEST_METHOD(TestMethod1)
{
//测试纯数字样本
File f;
Word w;
f.input = "./input2.txt";
f.Filein();
int num2 = w.Countwords(f.fin);
Assert::IsTrue(num2 == 0);
// TODO: 在此输入测试代码
}
};
6.测试基本案例(从爬取论文列表中选出其中一项,测试函数Countcharacters、Countlines、Countwords)
7.测试大型样本含权重样本输出词组(从爬取论文列表中选出其中多项,测试函数Countcharacters、Countlines、Countwords、Counttop10)
TEST_CLASS(TopTest1)
{
public:
TEST_METHOD(TestMethod1)
{
//测试大型样本含权重样本输出词组
File f;
Word w;
w.set(3, 1, 20);
f.input = "./top.txt";
f.Filein();
vector<pair<string, int>> v = w.Counttop10(f.fin, 20);
int characters = w.Countcharacters(f.fin);
int word = w.Countwords(f.fin);
int line = w.Countlines(f.fin);
vector<pair<string, int>>::iterator iter = v.begin();
Assert::IsTrue(characters == 2915 && word ==287 && line == 6 && iter->second == 11);
// TODO: 在此输入测试代码
}
};
8.测试大型样本不含权重样本输出词组
9.测试含权重样本的输出词组(从爬取论文列表中选出其中多项,读取词组内容,测试函数Countcharacters、Countlines、Countwords、Counttop10)
TEST_CLASS(PhraseTest1)
{
public:
TEST_METHOD(TestMethod1)
{
//测试含权重样本的输出词组
File f;
Word w;
w.set(3, 1, 66);
f.input = "./P.txt";
f.Filein();
vector<pair<string, int>> v = w.Counttop10(f.fin,66);
int characters = w.Countcharacters(f.fin);
int word = w.Countwords(f.fin);
int line = w.Countlines(f.fin);
int num = v.size();
vector<pair<string, int>>::iterator iter = v.begin();
Assert::IsTrue(characters == 817 && word == 80 && line == 2 && num == 38 && iter->first == "embodied question answering" && iter->second==11);
// TODO: 在此输入测试代码
}
};
有何收获
两个人一起解决问题时效率很高,并且可以一起讨论。
不足:没有
第N周 | 新增代码(行) | 累计代码(行) | 学习耗时(小时) | 重要成长 | |
---|---|---|---|---|---|
1 | 280 | 280 | 15 | c++输入输出流、词频统计、单元测试 | |
2 | 0 | 280 | 30 | NABCD模型、学习使用Axure RP 、原型设计 | |
3~4 | 461 | 731 | 35 | 爬虫技术、自定义控制台参数、性能分析和单元测试 |
原文:https://www.cnblogs.com/wzh7/p/9693318.html