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 |
target_url = ‘http://openaccess.thecvf.com/CVPR2018.py‘
target_req = request.Request(url = target_url, headers = head)
target_response = request.urlopen(target_req)
target_html = target_response.read().decode(‘utf-8‘)
#创建BeautifulSoup对象
listmain_soup = BeautifulSoup(target_html,‘lxml‘)
#搜索文档树,找出div标签中id为content的所有子标签
chapters = listmain_soup.find_all(‘div‘,id = ‘content‘)
#使用查询结果再创建一个BeautifulSoup对象,对其继续进行解析
download_soup = BeautifulSoup(str(chapters), ‘lxml‘)
file = open(‘.\\result.txt‘, ‘w‘, encoding=‘utf-8‘)
numbers = len(download_soup.dl.contents)
index = 0
#开始记录内容标志位,只要正文卷下面的链接,最新章节列表链接剔除
begin_flag = True
#遍历dl标签下所有子节点
for child in download_soup.dl.children:
#滤除回车
if(child != ‘\n‘ and child.name != "dd"):
print(child.name)
#爬取链接下载链接内容
if begin_flag == True and child.a != None:
download_url = "http://openaccess.thecvf.com/" + child.a.get(‘href‘)
download_req = request.Request(url = download_url, headers = head)
download_response = request.urlopen(download_req)
download_html = download_response.read().decode(‘utf-8‘)
download_name = child.a.string
soup_texts = BeautifulSoup(download_html, ‘lxml‘)
#改
texts = soup_texts.find_all(‘div‘,id = ‘content‘)
soup_text = BeautifulSoup(str(texts), ‘lxml‘)
write_flag = True
file.write(str(index) +‘\n‘)
#将爬取内容写入文件
file.write(‘Title: ‘+download_name + ‘\n‘)
#作者信息
# authors=soup_text.find(‘div‘,id = ‘authors‘)
# file.write(‘Title: ‘authors.string + ‘\n‘)
abstract=soup_text.find(‘div‘,id = ‘abstract‘)
file.write(‘Abstract: ‘+abstract.string[1:] + ‘\n‘)
file.write(‘\n\n‘)
index += 1
file.close()
设计的创意独到之处
实现思路
实现成果展示
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;
}
if (answord >= 4)
{
// 获得一个单词后
phraseans++;
phrase.push_back(i- answord);//单词位置送入队列当中
if (phraseans == countphrase)//判断队列长度是否符合
{
int lon = phrase.front();//词组起始位置;
phrase.pop_front();
str = name.substr(lon, i - lon);
mapword[str] = mapword[str] + beishu;
phraseans--;//输出队列中的首个单词位置
}
words++;
}
本次代码是在原有的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
程序中消耗最大的函数:
代码覆盖率达到了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 | 1200 | 1000 | 20 | 20 | VS初步学习,温习了c++ stl库 |
2 | 500 | 1700 | 12 | 32 | 学习了Axure RP,理解了NABCD模型 |
3 | 1000 | 2700 | 20 | 52 | 温习了Python,学习了一些Android开发的知识 |
4 | 500 | 3200 | 10 | 62 | 继续学习了一些Android开发的知识 |
原文:https://www.cnblogs.com/chennel/p/9781093.html