自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

say_c_box的博客

只是为了记录

  • 博客(263)
  • 收藏
  • 关注

原创 【一起读ACL】Facebook的开放式问答系统(Reading Wikipedia to Answer Open-Domain Questions)

Reading Wikipedia to Answer Open-Domain Questions这篇论文介绍了一个回答开放提问的模型。选择用维基百科中的一部分来作为答案。In order to answer any question, one must first retrieve the few relevant articles among more than 5 million items,

2018-04-03 21:13:35 978

原创 【一起读ACL论文】Attention-over-Attention Neural Networks for Reading Comprehension

一种针对完形填空式阅读理解的模型。综合来看,大概是双向考虑了文档->提问和提问->文档的关系。思想和实现都是非常简单的,从实验结果来看效果不错。而且也容易扩展到其他模型上。整个模型如上图所示。大概分为三个部分:和传统模型类似,先把Document和Query都embedding出来(用的是GRU)。根据向量表示计算出一个矩阵表示,记为Pair-wise Matchin...

2018-03-31 16:27:00 585

原创 用python从一个单词列表中快速生成word_to_ix字典

#set函数创建一个无序不重复的元素集,可进行关系测试,删除重复数据。还可以计算交集,差集,并集。vocab = set(test_sentence)#enumerate函数用于将一个可遍历的数据对象组合为一个索引序列。同时列出数据和数据下标。word_to_ix = {word: i for i, word in enumerate(vocab)}

2017-12-19 22:04:11 1993

原创 pytorch+lstm实现的pos

学了几天终于大概明白pytorch怎么用了 这个是直接搬运的官方文档的代码 之后会自己试着实现其他nlp的任务# Author: Robert Guthrieimport torchimport torch.autograd as autogradimport torch.nn as nnimport torch.nn.functional as Fimport torch.optim

2017-12-14 15:01:43 5120 1

原创 mmseg中文分词算法的python实现及其优化

mmseg中文分词算法的python实现及其优化任务定义实现一个中文分词系统并对其性能做测试。输入输出该分词的训练语料取自人民日报1998年公开的语料库。为了保证测试的严谨性,选择另一份语料库做测试文档。该文档为SIGHAN(国际计算语言学会(ACL)中文语言处理小组)举办的国际中文语言处理竞赛中提供的pku_test_gold语料。方法描述mmseg算法理解mmseg本质上就是前向最大匹配+消除歧

2017-11-16 14:23:31 2573 1

原创 python实现的基于hmm模型的词性标注系统

python实现的基于hmm模型的词性标注系统任务定义实现一个词性标注系统,输入分好词的单词序列,输出一个词性标注后的结果序使用的语料库为人民日报98年公开语料库,一共约18000行语料。在用户交互模式下,所有语料库均用作训练。在文件读写模式下,前3000行语句用来做测试,后面的语句用来做训练。方法描述隐马尔科夫模型理解隐马尔科夫模型是结构最简单的动态贝叶斯网络。描述由一个隐藏的马尔科夫链随机生成

2017-11-16 14:16:58 10460 6

原创 基于python实现的mmseg中文分词算法实现及其优化

mmseg中文分词算法的python实现及其优化mmseg算法理解mmseg本质上个人理解就是前向最大匹配+消除歧义规则+贪心,最简单的前向最大匹配就是,将每次从起点位置能匹配到的最长词语作为分词结果,连续进行下去。前向最大匹配符合人们的习惯,但是在某些语句中会产生歧义。例如北京大学生前来应聘,由于北京大学在词库中出现,所以前向最大匹配会分成北京大学/生/前来/应聘,显然这不是正确的分词结果。那么m

2017-11-07 00:08:17 1098

原创 POJ 1821--Fence(单调队列优化dp,总结一下)

FenceTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5185 Accepted: 1643DescriptionA team of k (1 <= K <= 100) workers should paint a fence which contai

2017-10-10 19:53:13 600

原创 CodeForces - 55D——Beautiful numbers (数位dp)

D. Beautiful numberstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVolodya is an odd boy and his taste is

2017-10-08 12:24:25 350

原创 HDU3401 Trade (动态规划+单调队列)

/*知道之后n天的股票买卖价格(api,bpi),以及每天股票买卖数量上限(asi,bsi),问他最多能赚多少钱。开始时有无限本金,要求任两次交易需要间隔W天以上,即第i天交易,第i+w+1天才能再交易。同时他任意时刻最多只能拥有maxp的股票,容易写出DP方程 dp[i][j]=max{dp[i-1][j],max{dp[r][k]-APi[i]*(j-k)}(0j)} 分别是第i天不交易

2017-09-07 21:13:25 466

原创 整数三分模板

/*整数三分模板*/int cal(int x){ int res; return res;}int solve(int l,int r){ while(r>l){ int m1=(2*l+r)/3; int m2=(2*r+l+2)/3; if(cal(m1)>cal(m2)) r-m2-1;

2017-09-06 18:46:37 2707

原创 浮点三分模板

/*浮点数三分模板*/const double EPS = 1e-10; double calc(double x) { double res; return res;} double ternarySearch(double l, double r) { double m, mm; while (l + EPS < r)

2017-09-06 18:44:04 395

原创 倍增法求lca模板

/*倍增法求lca*/const int maxlogv=16;int f[maxlogv][MAXN];int dep[MAXN];//先dfsvoid lca_init(){ for(int k=0;k+1<maxlogv;++k){ for(int v=1;v<=n;++v){ if(f[k][v]==0) f[k+1][v]=0

2017-09-04 16:06:38 407

原创 马拉车算法模板

#include #include #include using namespace std;void findBMstr(string str0){ string str; str += "$#"; int n=str0.size(); for(int i = 0; i < n; i++){ str += str0[i];

2017-08-31 14:26:58 1326

原创 POJ3347 Kadj Squares(计算几何)

Kadj SquaresTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 3296 Accepted: 1307DescriptionIn this problem, you are given a sequence S1, S2, ..., Sn of

2017-08-31 14:09:59 380

原创 POJ1696 space ant(计算几何,极角排序)

Space AntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4656 Accepted: 2925DescriptionThe most exciting space discovery occurred at the end of the 20

2017-08-31 14:04:52 422

原创 POJ410 Intersection 计算几何

IntersectionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15317 Accepted: 4008DescriptionYou are to write a program that has to decide whether a giv

2017-08-31 13:37:09 318

原创 POJ066 Treasure Hunt(计算几何)

Treasure HuntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7387 Accepted: 3046DescriptionArcheologists from the Antiquities and Curios Museum (ACM) ha

2017-08-31 13:34:41 567

原创 POJ2653 Pick-up sticks(计算几何)

Pick-up sticksTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 13739 Accepted: 5210DescriptionStan has n sticks of various length. He throws them one a

2017-08-31 13:09:36 415

原创 POJ1556——The Doors 计算几何,最短路

The DoorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9012 Accepted: 3458DescriptionYou are to find the length of the shortest path through a chamb

2017-08-30 16:22:51 479

原创 POJ1269——Intersecting Lines(计算几何,直线关系判断)

Intersecting LinesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16680 Accepted: 7191DescriptionWe all know that a pair of distinct points on a plane

2017-08-30 16:18:48 360

原创 POJ3304 Segments(计算几何,线段和直线的交点)

SegmentsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 15325 Accepted: 4859DescriptionGiven n segments in the two dimensional space, write a progra

2017-08-30 16:11:08 391

原创 POJ2318 TOYS(叉积,计算几何)

TOYSTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 16234 Accepted: 7786DescriptionCalculate the number of toys that land in each bin of a partitioned

2017-08-30 15:59:28 289

原创 Relevant Phrases of Annihilation SPOJ - PHRASES 后缀数组

PHRASES - Relevant Phrases of Annihilationno tags You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned a

2017-08-29 22:41:47 365

原创 POJ3294——Life Forms 后缀数组

Life FormsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 15912 Accepted: 4695DescriptionYou may have wondered why most extraterrestrial life forms

2017-08-29 22:22:59 400

原创 POJ3415 Common Substrings(后缀数组,单调栈)

Common SubstringsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 11195 Accepted: 3701DescriptionA substring of a string T is defined as:T(i, k)=

2017-08-29 21:26:51 316

原创 POJ2774 Long Long Message(后缀数组)

Long Long MessageTime Limit: 4000MS Memory Limit: 131072KTotal Submissions: 31523 Accepted: 12719Case Time Limit: 1000MSDescriptionThe little cat is major

2017-08-29 20:52:37 296

原创 POJ3693 Maximum repetition substring (后缀数组)

The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "ababab" is 3 and

2017-08-29 20:46:56 304

转载 SPOJ - REPEATS Repeats (后缀数组)

REPEATS - Repeatsno tags A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the string s = abaabaabaaba

2017-08-29 20:23:18 276

原创 POJ2406——Power Strings(后缀数组)

Power StringsTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 51218 Accepted: 21386DescriptionGiven two strings a and b we define a*b to be their conca

2017-08-29 20:16:48 539

原创 SPOJ - DISUBSTR Distinct Substrings (后缀数组)

DISUBSTR - Distinct Substringsno tags Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. TEach test case consists of one st

2017-08-29 19:31:38 305

原创 HDU5493 Queue(线段树)

QueueTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1363    Accepted Submission(s): 689Problem DescriptionN people numbered f

2017-08-29 19:22:26 227

原创 HDU5492 Find a path (动态规划)

Find a pathTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1866    Accepted Submission(s): 809Problem DescriptionFrog fell into

2017-08-29 19:16:46 276

原创 HDU6096 string(字典树)

StringTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1037    Accepted Submission(s): 335Problem DescriptionBob has a dictiona

2017-08-28 20:39:28 335

原创 Gym - 101194F Mr. Panda and Fantastic Beasts (后缀数组)

题意:给出n个字符串,找到最短的字符串,要求仅为第一个字符串的子串。思路:把n个字符串用不出现的字符连接起来。其实就是枚举第一个字符串的每一个子串是否是其他字符串的后缀的前缀即可。#include#include#include #include #include using namespace std;const int MAXN=400000+10;const i

2017-08-28 19:36:16 1213

原创 HDU6078 Wavel Sequence(动态规划)

Wavel SequenceTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 728    Accepted Submission(s): 377Problem DescriptionHave you ev

2017-08-28 19:28:22 367

原创 HDU6074 Phone Call(并查集,lca)

Phone CallTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 395    Accepted Submission(s): 163Problem DescriptionThere are n hou

2017-08-28 19:17:50 297

原创 POJ6071 Lazy Running(最短路)

Lazy RunningTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1301    Accepted Submission(s): 557Problem DescriptionIn HDU, you

2017-08-28 15:50:40 235

原创 codefcodeforces 845D Driving Test(栈)

Driving Testtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has just attempted to pass the drivin

2017-08-28 02:23:18 609

原创 HDU6059 Kanade's trio(异或字典树)

Kanade's trioTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 1067    Accepted Submission(s): 392Problem DescriptionGive you an

2017-08-27 14:49:05 359

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除