关于claws4格式的问题

maggieq58

语料人生
原本规矩的文本(段落分明)经过claws4标注后,都被分割成一个个独立成行的句子,原来的段落格式都没有了。

1有什么办法可以批量的把这个格式调整成原来段落分明的格式?
2段落标记如何能批量的打好?
 
回复: 关于claws4格式的问题

Before you POS tag your texts, replace all paragraph marks or carriage returns with </p><p>, provided that your texts are good enough, namely paragraphs are separated with one and only one carriage return.

Then add a <p> to the beginning of each file.

Do a 'search and replace' with PowerGREP; the conversion can be achieved with one or two steps.

MS Word is not recommended if you have hundreds of texts to be processed, because Word processes one opened text at a time. I don't think you can afford the time of cleaning a corpus like BNC (4054 texts) one text after another.
 
回复: 关于claws4格式的问题

原本规矩的文本(段落分明)经过claws4标注后,都被分割成一个个独立成行的句子,原来的段落格式都没有了。

1有什么办法可以批量的把这个格式调整成原来段落分明的格式?
2段落标记如何能批量的打好?

要想这样做,在词性标注之前就得给每一个段落的起始位置加上一个唯一的标识码。这应该是很容易办到的事情。然后再用Claws4进行标注。标注完之后,分两步进行,一取消段落,即以句为单位的段落,让所有的句子组成一个段落;二根据事先加上的段落标识,比如<p>再将文本分成标注前的段落样子。这个工作在EditPlus和MSword里都可以操作。前者用\n来进行(正则),后者用^p来进行(通配符)。
 
回复: 关于claws4格式的问题

我实际操作了下,发现段落尾部不能提前添加</p>,因为这样标注的结果是:

(一个文本的最后面)Also weak government, especially within Britains 3 party system where the balance of power would always be held by the Liberal Democrats and the National Parties.</p>


<s>
Also_RR weak_JJ government_NN1 ,_, especially_RR within_II Britains_NN2 3_MC party_NN1 system_NN1 where_CS the_AT balance_NN1 of_IO power_NN1 would_VM always_RR be_VBI held_VVN by_II the_AT Liberal_JJ Democrats_NN2 and_CC the_AT National_JJ Parties_NN2 ._. </p>_NULL
</s>

也就是他把</s>标记打到了段落标记的</p>的外面,这样正好是反了。

前<p>也不行, <p>_NULL </s> 结果是这样。 我可能没理解
 
回复: 关于claws4格式的问题

原文本:
<p>Although Britain is said to have the oldest democrasy in the world, however in many way this democrasy can be seen to be antiquated, old fashioned and unfair. There has not be whole sale reform of the electral system within Britain since women were granted the vote in the 1920's. This only alowed a growth in the electorate with the system of voting not having changed since the last century. This above all else can be seen to make Britain an undemocratic country.</p>
<p>The system used within Britain is known as the "First past the post" system. This is the system of direct constituencies. within these constiuencies the candidate with the largest number of votes is elected. This means that in many areas candidates are elected with under 50% of the total vote within that constituency. These successful candidate move on to the House of Commons to become MPs. This creates a house of representatives voted in by a minority vote in many cases (the only exceptions being for instance Huntington or Islington two very safe seats). This led the times when at a general election when parties have come to power with less votes than the main opposition party. This was the case in 1970 with the Conservative victory under Edward Heath. Many would argue that the weaknesses and unfairness of this system are apparent and that it should be changed. However there are strengths to this system. The first past the post system always leads to strong government usually leaving the governing party with a workable majority. Much of the work, to bring Britain into the modern economic world, done by the conservatives in the early 1960's was done through the first past the post system; The other option is proportional representation which is seen to give more say to the electorate on who get elected. But unfortunatly this system can lead to weak government allowing the growth of political extremist parties, through the ability to have a member of Parliament even with the overall vote. Also weak government, especially within Britains 3 party system where the balance of power would always be held by the Liberal Democrats and the National Parties.</p>

标注后:

<s>
</s>
<s>
Although_CS Britain_NP1 is_VBZ said_VVN to_TO have_VHI the_AT oldest_JJT democrasy_NN1 in_II the_AT world_NN1 ,_, however_RR in_II many_DA2 way_NN1 this_DD1 democrasy_NN1 can_VM be_VBI seen_VVN to_TO be_VBI antiquated_JJ ,_, old_JJ21 fashioned_JJ22 and_CC unfair_JJ ._.
</s>
<s>
There_EX has_VHZ not_XX be_VBI whole_JJ sale_NN1 reform_NN1 of_IO the_AT electral_JJ system_NN1 within_II Britain_NP1 since_CS women_NN2 were_VBDR granted_VVN the_AT vote_NN1 in_II the_AT 1920_MC 's_GE ._.
</s>
<s>
This_DD1 only_RR alowed_VVD a_AT1 growth_NN1 in_II the_AT electorate_NN1 with_IW the_AT system_NN1 of_IO voting_VVG not_XX having_VHG changed_VVN since_CS the_AT last_MD century_NNT1 ._.
</s>
<s>
This_DD1 above_II all_DB else_RR can_VM be_VBI seen_VVN to_TO make_VVI Britain_NP1 an_AT1 undemocratic_JJ country_NN1 ._. </p>_NULL <p>_NULL
</s>

<s>
The_AT system_NN1 used_VVN within_II Britain_NP1 is_VBZ known_VVN as_II the_AT "_" First_MD past_II the_AT post_NN1 "_" system_NN1 ._.
</s>
<s>
This_DD1 is_VBZ the_AT system_NN1 of_IO direct_JJ constituencies_NN2 ._.
</s>
<s>
within_II these_DD2 constiuencies_NN2 the_AT candidate_NN1 with_IW the_AT largest_JJT number_NN1 of_IO votes_NN2 is_VBZ elected_VVN ._.
</s>
<s>
This_DD1 means_VVZ that_CST in_II many_DA2 areas_NN2 candidates_NN2 are_VBR elected_VVN with_IW under_RG 50%_NNU of_IO the_AT total_JJ vote_NN1 within_II that_DD1 constituency_NN1 ._.
</s>
<s>
These_DD2 successful_JJ candidate_NN1 move_NN1 on_II21 to_II22 the_AT House_NN1 of_IO Commons_NP to_TO become_VVI MPs_NNU ._.
</s>
<s>
This_DD1 creates_VVZ a_AT1 house_NN1 of_IO representatives_NN2 voted_VVD in_RP by_II a_AT1 minority_NN1 vote_NN1 in_II many_DA2 cases_NN2 (_( the_AT only_JJ exceptions_NN2 being_VBG for_REX21 instance_REX22 Huntington_NP1 or_CC Islington_NP1 two_MC very_RG safe_JJ seats_NN2 )_) ._.
</s>
<s>
This_DD1 led_VVD the_AT times_NNT2 when_RRQ at_II a_AT1 general_JJ election_NN1 when_RRQ parties_NN2 have_VH0 come_VVN to_II power_NN1 with_IW less_DAR votes_NN2 than_CSN the_AT main_JJ opposition_NN1 party_NN1 ._.
</s>
<s>
This_DD1 was_VBDZ the_AT case_NN1 in_II 1970_MC with_IW the_AT Conservative_JJ victory_NN1 under_II Edward_NP1 Heath_NP1 ._.
</s>
<s>
Many_DA2 would_VM argue_VVI that_CST the_AT weaknesses_NN2 and_CC unfairness_NN1 of_IO this_DD1 system_NN1 are_VBR apparent_JJ and_CC that_CST it_PPH1 should_VM be_VBI changed_VVN ._.
</s>
<s>
However_RR there_EX are_VBR strengths_NN2 to_II this_DD1 system_NN1 ._.
</s>
<s>
The_AT first_MD past_II the_AT post_NN1 system_NN1 always_RR leads_VVZ to_II strong_JJ government_NN1 usually_RR leaving_VVG the_AT governing_JJ party_NN1 with_IW a_AT1 workable_JJ majority_NN1 ._.
</s>
<s>
Much_DA1 of_IO the_AT work_NN1 ,_, to_TO bring_VVI Britain_NP1 into_II the_AT modern_JJ economic_JJ world_NN1 ,_, done_VDN by_II the_AT conservatives_NN2 in_II the_AT early_JJ 1960_MC221 's_MC222 was_VBDZ done_VDN through_II the_AT first_MD past_II the_AT post_NN1 system_NN1 ;_; The_AT other_JJ option_NN1 is_VBZ proportional_JJ representation_NN1 which_DDQ is_VBZ seen_VVN to_TO give_VVI more_RRR say_VV0 to_II the_AT electorate_NN1 on_II who_PNQS get_VV0 elected_VVN ._.
</s>
<s>
But_CCB unfortunatly_RR this_DD1 system_NN1 can_VM lead_VVI to_II weak_JJ government_NN1 allowing_VVG the_AT growth_NN1 of_IO political_JJ extremist_JJ parties_NN2 ,_, through_II the_AT ability_NN1 to_TO have_VHI a_AT1 member_NN1 of_IO Parliament_NN1 even_RR with_IW the_AT overall_JJ vote_NN1 ._.
</s>
<s>
Also_RR weak_JJ government_NN1 ,_, especially_RR within_II Britains_NN2 3_MC party_NN1 system_NN1 where_CS the_AT balance_NN1 of_IO power_NN1 would_VM always_RR be_VBI held_VVN by_II the_AT Liberal_JJ Democrats_NN2 and_CC the_AT National_JJ Parties_NN2 ._. </p>_NULL
</s>

观测红色的部分,好像和我们想要的结果相反?!因为<p>..</p>应该是嵌套在<s>..</s>外的。

首先第一个<p>标记后消失了。变成了<s></s>
第二,其它的段落标记和句子编辑嵌套反了。

还请指点,一定是我操作不当,没理解2位的意思。感谢。
 
回复: 关于claws4格式的问题

通过自己的笨办法也算解决了。错中求规律吧。几个步骤下来也算弄出自己想要的。感谢各位了。
 
回复: 关于claws4格式的问题

通过自己的笨办法也算解决了。错中求规律吧。几个步骤下来也算弄出自己想要的。感谢各位了。


最好的感谢是分享。弄出来就先跑了?太不厚道了!
把你那“笨办法”、“几个步骤”帖出来与大家分享一下!:D
 
回复: 关于claws4格式的问题

最好的感谢是分享。弄出来就先跑了?太不厚道了!
把你那“笨办法”、“几个步骤”帖出来与大家分享一下!:D

为什么要逼我!?呵呵,说是笨办法真是笨办法。上面的帖子说了,先打了标记就反了。我的办法就是我批量再替换回来!哈哈
比如</p></s> 那我就</s></p>替换。。。。。。真是笨到家了。不过麻烦几下,结果也一样。但聪明人和笨人的区别就在这里了。人家是电扇,我是手动扇风,哈哈
 
回复: 关于claws4格式的问题

为什么要逼我!?呵呵,说是笨办法真是笨办法。上面的帖子说了,先打了标记就反了。我的办法就是我批量再替换回来!哈哈
祝贺!“批量再替换”是何等的高明,何笨之有?:D
 
Back
顶部