From 6a3397e6c6b34b857b6f70ee0e4b8d9f3fd359f6 Mon Sep 17 00:00:00 2001 From: Sherin Thomas Date: Sun, 31 Jul 2016 18:26:58 +0530 Subject: [PATCH] directory structure change --- ProjectPyco/README.md | 9 -- ProjectPyco/pyco/out.txt | 185 ------------------------- ProjectPyco/licence.txt => licence.txt | 0 pyco.cfg | 3 - {ProjectPyco/pyco => pyco}/__init__.py | 0 {ProjectPyco/pyco => pyco}/__main__.py | 0 {ProjectPyco/pyco => pyco}/pyco.py | 0 server.sh | 2 - test/test_pyco_nlp.py | 14 -- 9 files changed, 213 deletions(-) delete mode 100644 ProjectPyco/README.md delete mode 100644 ProjectPyco/pyco/out.txt rename ProjectPyco/licence.txt => licence.txt (100%) delete mode 100644 pyco.cfg rename {ProjectPyco/pyco => pyco}/__init__.py (100%) rename {ProjectPyco/pyco => pyco}/__main__.py (100%) rename {ProjectPyco/pyco => pyco}/pyco.py (100%) delete mode 100755 server.sh delete mode 100644 test/test_pyco_nlp.py diff --git a/ProjectPyco/README.md b/ProjectPyco/README.md deleted file mode 100644 index e5065a4..0000000 --- a/ProjectPyco/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# pyco -##CoreNLP v3.6.0 -###Powerfull python wrapper for Stanford CoreNLP project -- If user did not mention output format, use json - notify -- configuration for logging -- function for fetching the standard output of stanford nlp -- function for getting every annotator in saperate lists -- functions for generating above lists independantly -- option to fetch the url and annotators from conguration \ No newline at end of file diff --git a/ProjectPyco/pyco/out.txt b/ProjectPyco/pyco/out.txt deleted file mode 100644 index 2195d43..0000000 --- a/ProjectPyco/pyco/out.txt +++ /dev/null @@ -1,185 +0,0 @@ -Sentence #1 (9 tokens): -AFGHANISTAN:26.6 26.6 Odhiambo to Ashraf, FOUR!! -[Text=AFGHANISTAN CharacterOffsetBegin=0 CharacterOffsetEnd=11 PartOfSpeech=NNP Lemma=AFGHANISTAN TrueCase=O TrueCaseText=AFGHANISTAN NamedEntityTag=LOCATION] -[Text=:26.6 CharacterOffsetBegin=11 CharacterOffsetEnd=16 PartOfSpeech=CD Lemma=:26.6 TrueCase=O TrueCaseText=:26.6 NamedEntityTag=NUMBER] -[Text=26.6 CharacterOffsetBegin=17 CharacterOffsetEnd=21 PartOfSpeech=CD Lemma=26.6 TrueCase=O TrueCaseText=26.6 NamedEntityTag=NUMBER NormalizedNamedEntityTag=26.6] -[Text=Odhiambo CharacterOffsetBegin=22 CharacterOffsetEnd=30 PartOfSpeech=NNP Lemma=Odhiambo TrueCase=UPPER TrueCaseText=ODHIAMBO NamedEntityTag=PERSON] -[Text=to CharacterOffsetBegin=31 CharacterOffsetEnd=33 PartOfSpeech=TO Lemma=to TrueCase=UPPER TrueCaseText=TO NamedEntityTag=O] -[Text=Ashraf CharacterOffsetBegin=34 CharacterOffsetEnd=40 PartOfSpeech=NNP Lemma=Ashraf TrueCase=UPPER TrueCaseText=ASHRAF NamedEntityTag=PERSON] -[Text=, CharacterOffsetBegin=40 CharacterOffsetEnd=41 PartOfSpeech=, Lemma=, TrueCase=O TrueCaseText=, NamedEntityTag=O] -[Text=FOUR CharacterOffsetBegin=42 CharacterOffsetEnd=46 PartOfSpeech=CD Lemma=four TrueCase=O TrueCaseText=FOUR NamedEntityTag=NUMBER NormalizedNamedEntityTag=4.0] -[Text=!! CharacterOffsetBegin=46 CharacterOffsetEnd=48 PartOfSpeech=CD Lemma=!! TrueCase=O TrueCaseText=!! NamedEntityTag=NUMBER] -(ROOT - (NP - (NP (NNP AFGHANISTAN) (CD :26.6)) - (NP - (NP (NNP 26.6) (NNP Odhiambo)) - (PP (TO to) - (NP (NNP Ashraf) (, ,) (NNP FOUR) (NNP !!)))))) - -root(ROOT-0, AFGHANISTAN-1) -nummod(Odhiambo-4, :26.6-2) -nummod(Odhiambo-4, 26.6-3) -dep(AFGHANISTAN-1, Odhiambo-4) -case(Ashraf-6, to-5) -nmod:to(Odhiambo-4, Ashraf-6) -punct(Odhiambo-4, ,-7) -compound(!!-9, FOUR-8) -nummod(Odhiambo-4, !!-9) - -Extracted the following MachineReading entity mentions: - EntityMention [type=LOCATION, objectId=EntityMention-1, hstart=0, hend=1, estart=0, eend=1, headPosition=0, value="AFGHANISTAN", corefID=-1] - EntityMention [type=O, objectId=EntityMention-2, hstart=2, hend=3, estart=1, eend=3, headPosition=2, value="26.6", corefID=-1] - EntityMention [type=PEOPLE, objectId=EntityMention-3, hstart=3, hend=4, estart=3, eend=4, headPosition=3, value="Odhiambo", corefID=-1] - EntityMention [type=PEOPLE, objectId=EntityMention-4, hstart=5, hend=6, estart=5, eend=6, headPosition=5, value="Ashraf", corefID=-1] - EntityMention [type=O, objectId=EntityMention-5, hstart=7, hend=8, estart=7, eend=9, headPosition=7, value="FOUR", corefID=-1] -Extracted the following MachineReading relation mentions: -RelationMention [type=Located_In, start=1, end=6, {Located_In, 0.26492488316019197; OrgBased_In, 0.22497162786285613; Live_In, 0.21096421199305165; Work_For, 0.16638765301168454; _NR, 0.13275162397221568} - EntityMention [type=O, objectId=EntityMention-2, hstart=2, hend=3, estart=1, eend=3, headPosition=2, value="26.6", corefID=-1] - EntityMention [type=PEOPLE, objectId=EntityMention-4, hstart=5, hend=6, estart=5, eend=6, headPosition=5, value="Ashraf", corefID=-1] -] -RelationMention [type=Located_In, start=3, end=9, {Located_In, 0.2711389378223004; OrgBased_In, 0.22526977516948965; Live_In, 0.21021107250239002; Work_For, 0.1656680391881638; _NR, 0.12771217531765622} - EntityMention [type=PEOPLE, objectId=EntityMention-3, hstart=3, hend=4, estart=3, eend=4, headPosition=3, value="Odhiambo", corefID=-1] - EntityMention [type=O, objectId=EntityMention-5, hstart=7, hend=8, estart=7, eend=9, headPosition=7, value="FOUR", corefID=-1] -] -RelationMention [type=Work_For, start=1, end=6, {Work_For, 0.28733363622219416; _NR, 0.273737174112491; Live_In, 0.1880648100384372; Located_In, 0.12989044859421622; OrgBased_In, 0.12097393103266155} - EntityMention [type=PEOPLE, objectId=EntityMention-4, hstart=5, hend=6, estart=5, eend=6, headPosition=5, value="Ashraf", corefID=-1] - EntityMention [type=O, objectId=EntityMention-2, hstart=2, hend=3, estart=1, eend=3, headPosition=2, value="26.6", corefID=-1] -] -RelationMention [type=Located_In, start=5, end=9, {Located_In, 0.4547679853307117; _NR, 0.3693486525836508; Work_For, 0.06364354407437335; OrgBased_In, 0.06234552034679701; Live_In, 0.04989429766446719} - EntityMention [type=PEOPLE, objectId=EntityMention-4, hstart=5, hend=6, estart=5, eend=6, headPosition=5, value="Ashraf", corefID=-1] - EntityMention [type=O, objectId=EntityMention-5, hstart=7, hend=8, estart=7, eend=9, headPosition=7, value="FOUR", corefID=-1] -] -RelationMention [type=Work_For, start=3, end=9, {Work_For, 0.2887178490829071; _NR, 0.26576376503857235; Live_In, 0.18911408176116254; Located_In, 0.134157786484829; OrgBased_In, 0.12224651763252892} - EntityMention [type=O, objectId=EntityMention-5, hstart=7, hend=8, estart=7, eend=9, headPosition=7, value="FOUR", corefID=-1] - EntityMention [type=PEOPLE, objectId=EntityMention-3, hstart=3, hend=4, estart=3, eend=4, headPosition=3, value="Odhiambo", corefID=-1] -] -RelationMention [type=Located_In, start=5, end=9, {Located_In, 0.4547679853307117; _NR, 0.3693486525836508; Work_For, 0.06364354407437335; OrgBased_In, 0.06234552034679701; Live_In, 0.04989429766446719} - EntityMention [type=O, objectId=EntityMention-5, hstart=7, hend=8, estart=7, eend=9, headPosition=7, value="FOUR", corefID=-1] - EntityMention [type=PEOPLE, objectId=EntityMention-4, hstart=5, hend=6, estart=5, eend=6, headPosition=5, value="Ashraf", corefID=-1] -] -Sentence #2 (38 tokens): -, short again outside off, Ashraf moves back and pulls it effortlessly to deep mid wicket fence, a convincing win in the end for the Afghans as they win the match with 23 overs to spare -[Text=, CharacterOffsetBegin=49 CharacterOffsetEnd=50 PartOfSpeech=, Lemma=, TrueCase=O TrueCaseText=, NamedEntityTag=O] -[Text=short CharacterOffsetBegin=51 CharacterOffsetEnd=56 PartOfSpeech=JJ Lemma=short TrueCase=INIT_UPPER TrueCaseText=Short NamedEntityTag=O] -[Text=again CharacterOffsetBegin=57 CharacterOffsetEnd=62 PartOfSpeech=RB Lemma=again TrueCase=LOWER TrueCaseText=again NamedEntityTag=O] -[Text=outside CharacterOffsetBegin=63 CharacterOffsetEnd=70 PartOfSpeech=IN Lemma=outside TrueCase=LOWER TrueCaseText=outside NamedEntityTag=O] -[Text=off CharacterOffsetBegin=71 CharacterOffsetEnd=74 PartOfSpeech=RB Lemma=off TrueCase=LOWER TrueCaseText=off NamedEntityTag=O] -[Text=, CharacterOffsetBegin=74 CharacterOffsetEnd=75 PartOfSpeech=, Lemma=, TrueCase=O TrueCaseText=, NamedEntityTag=O] -[Text=Ashraf CharacterOffsetBegin=76 CharacterOffsetEnd=82 PartOfSpeech=NN Lemma=ashraf TrueCase=UPPER TrueCaseText=ASHRAF NamedEntityTag=PERSON] -[Text=moves CharacterOffsetBegin=83 CharacterOffsetEnd=88 PartOfSpeech=VBZ Lemma=move TrueCase=LOWER TrueCaseText=moves NamedEntityTag=O] -[Text=back CharacterOffsetBegin=89 CharacterOffsetEnd=93 PartOfSpeech=RB Lemma=back TrueCase=LOWER TrueCaseText=back NamedEntityTag=O] -[Text=and CharacterOffsetBegin=94 CharacterOffsetEnd=97 PartOfSpeech=CC Lemma=and TrueCase=LOWER TrueCaseText=and NamedEntityTag=O] -[Text=pulls CharacterOffsetBegin=98 CharacterOffsetEnd=103 PartOfSpeech=VBZ Lemma=pull TrueCase=LOWER TrueCaseText=pulls NamedEntityTag=O] -[Text=it CharacterOffsetBegin=104 CharacterOffsetEnd=106 PartOfSpeech=PRP Lemma=it TrueCase=LOWER TrueCaseText=it NamedEntityTag=O] -[Text=effortlessly CharacterOffsetBegin=107 CharacterOffsetEnd=119 PartOfSpeech=RB Lemma=effortlessly TrueCase=LOWER TrueCaseText=effortlessly NamedEntityTag=O] -[Text=to CharacterOffsetBegin=120 CharacterOffsetEnd=122 PartOfSpeech=TO Lemma=to TrueCase=LOWER TrueCaseText=to NamedEntityTag=O] -[Text=deep CharacterOffsetBegin=123 CharacterOffsetEnd=127 PartOfSpeech=JJ Lemma=deep TrueCase=LOWER TrueCaseText=deep NamedEntityTag=O] -[Text=mid CharacterOffsetBegin=128 CharacterOffsetEnd=131 PartOfSpeech=JJ Lemma=mid TrueCase=LOWER TrueCaseText=mid NamedEntityTag=O] -[Text=wicket CharacterOffsetBegin=132 CharacterOffsetEnd=138 PartOfSpeech=NN Lemma=wicket TrueCase=LOWER TrueCaseText=wicket NamedEntityTag=O] -[Text=fence CharacterOffsetBegin=139 CharacterOffsetEnd=144 PartOfSpeech=NN Lemma=fence TrueCase=LOWER TrueCaseText=fence NamedEntityTag=O] -[Text=, CharacterOffsetBegin=144 CharacterOffsetEnd=145 PartOfSpeech=, Lemma=, TrueCase=O TrueCaseText=, NamedEntityTag=O] -[Text=a CharacterOffsetBegin=146 CharacterOffsetEnd=147 PartOfSpeech=DT Lemma=a TrueCase=LOWER TrueCaseText=a NamedEntityTag=O] -[Text=convincing CharacterOffsetBegin=148 CharacterOffsetEnd=158 PartOfSpeech=JJ Lemma=convincing TrueCase=LOWER TrueCaseText=convincing NamedEntityTag=O] -[Text=win CharacterOffsetBegin=159 CharacterOffsetEnd=162 PartOfSpeech=VB Lemma=win TrueCase=LOWER TrueCaseText=win NamedEntityTag=O] -[Text=in CharacterOffsetBegin=163 CharacterOffsetEnd=165 PartOfSpeech=IN Lemma=in TrueCase=LOWER TrueCaseText=in NamedEntityTag=O] -[Text=the CharacterOffsetBegin=166 CharacterOffsetEnd=169 PartOfSpeech=DT Lemma=the TrueCase=LOWER TrueCaseText=the NamedEntityTag=O] -[Text=end CharacterOffsetBegin=170 CharacterOffsetEnd=173 PartOfSpeech=NN Lemma=end TrueCase=LOWER TrueCaseText=end NamedEntityTag=O] -[Text=for CharacterOffsetBegin=174 CharacterOffsetEnd=177 PartOfSpeech=IN Lemma=for TrueCase=LOWER TrueCaseText=for NamedEntityTag=O] -[Text=the CharacterOffsetBegin=178 CharacterOffsetEnd=181 PartOfSpeech=DT Lemma=the TrueCase=LOWER TrueCaseText=the NamedEntityTag=O] -[Text=Afghans CharacterOffsetBegin=182 CharacterOffsetEnd=189 PartOfSpeech=NNPS Lemma=Afghans TrueCase=INIT_UPPER TrueCaseText=Afghans NamedEntityTag=MISC] -[Text=as CharacterOffsetBegin=190 CharacterOffsetEnd=192 PartOfSpeech=IN Lemma=as TrueCase=LOWER TrueCaseText=as NamedEntityTag=O] -[Text=they CharacterOffsetBegin=193 CharacterOffsetEnd=197 PartOfSpeech=PRP Lemma=they TrueCase=LOWER TrueCaseText=they NamedEntityTag=O] -[Text=win CharacterOffsetBegin=198 CharacterOffsetEnd=201 PartOfSpeech=VBP Lemma=win TrueCase=LOWER TrueCaseText=win NamedEntityTag=O] -[Text=the CharacterOffsetBegin=202 CharacterOffsetEnd=205 PartOfSpeech=DT Lemma=the TrueCase=LOWER TrueCaseText=the NamedEntityTag=O] -[Text=match CharacterOffsetBegin=206 CharacterOffsetEnd=211 PartOfSpeech=NN Lemma=match TrueCase=LOWER TrueCaseText=match NamedEntityTag=O] -[Text=with CharacterOffsetBegin=212 CharacterOffsetEnd=216 PartOfSpeech=IN Lemma=with TrueCase=LOWER TrueCaseText=with NamedEntityTag=O] -[Text=23 CharacterOffsetBegin=217 CharacterOffsetEnd=219 PartOfSpeech=CD Lemma=23 TrueCase=O TrueCaseText=23 NamedEntityTag=NUMBER NormalizedNamedEntityTag=23.0] -[Text=overs CharacterOffsetBegin=220 CharacterOffsetEnd=225 PartOfSpeech=NNS Lemma=over TrueCase=LOWER TrueCaseText=overs NamedEntityTag=O] -[Text=to CharacterOffsetBegin=226 CharacterOffsetEnd=228 PartOfSpeech=TO Lemma=to TrueCase=LOWER TrueCaseText=to NamedEntityTag=O] -[Text=spare CharacterOffsetBegin=229 CharacterOffsetEnd=234 PartOfSpeech=VB Lemma=spare TrueCase=LOWER TrueCaseText=spare NamedEntityTag=O] -(ROOT - (S - (SBAR - (PRN (, ,) - (ADVP - (ADVP (RB short) (RB again) (JJ outside)) - (RB off)) - (, ,)) - (S - (NP (NNP Ashraf)) - (VP - (VP (VBZ moves) - (ADVP (RB back))) - (CC and) - (VP (VBZ pulls) - (NP (PRP it)) - (ADVP (RB effortlessly)) - (PP (TO to) - (NP (JJ deep) (JJ mid) (NN wicket) (NN fence))))))) - (, ,) - (NP (DT a) (NN convincing)) - (VP (VBP win) - (PP (IN in) - (NP - (NP (DT the) (NN end)) - (PP (IN for) - (NP (DT the) (NNPS Afghans))))) - (SBAR (IN as) - (S - (NP (PRP they)) - (VP (VBP win) - (NP (DT the) (NN match)) - (PP (IN with) - (NP (CD 23) (NNS overs))) - (S - (VP (TO to) - (VP (VB spare)))))))))) - -root(ROOT-0, moves-8) -punct(moves-8, ,-1) -advcl(moves-8, short-2) -advmod(off-5, again-3) -advmod(off-5, outside-4) -advmod(short-2, off-5) -punct(moves-8, ,-6) -nsubj(moves-8, Ashraf-7) -advmod(moves-8, back-9) -cc(moves-8, and-10) -conj:and(moves-8, pulls-11) -dobj(pulls-11, it-12) -advmod(pulls-11, effortlessly-13) -case(fence-18, to-14) -amod(fence-18, deep-15) -amod(fence-18, mid-16) -compound(fence-18, wicket-17) -nmod:to(pulls-11, fence-18) -punct(pulls-11, ,-19) -det(win-22, a-20) -amod(win-22, convincing-21) -dobj(pulls-11, win-22) -case(end-25, in-23) -det(end-25, the-24) -nmod:in(win-22, end-25) -case(Afghans-28, for-26) -det(Afghans-28, the-27) -nmod:for(end-25, Afghans-28) -mark(win-31, as-29) -nsubj(win-31, they-30) -advcl(win-22, win-31) -det(match-33, the-32) -dobj(win-31, match-33) -case(overs-36, with-34) -nummod(overs-36, 23-35) -nmod:with(win-31, overs-36) -mark(spare-38, to-37) -advcl(win-31, spare-38) - -Extracted the following MachineReading entity mentions: - EntityMention [type=PEOPLE, objectId=EntityMention-6, hstart=6, hend=7, estart=6, eend=7, headPosition=6, value="Ashraf", corefID=-1] - EntityMention [type=O, objectId=EntityMention-7, hstart=27, hend=28, estart=27, eend=28, headPosition=27, value="Afghans", corefID=-1] - EntityMention [type=O, objectId=EntityMention-8, hstart=34, hend=35, estart=34, eend=35, headPosition=34, value="23", corefID=-1] -Extracted the following MachineReading relation mentions: -Coreference set: - (2,12,[12,13]) -> (1,1,[1,10]), that is: "it" -> "AFGHANISTAN :26.6 26.6 Odhiambo to Ashraf , FOUR !!" - diff --git a/ProjectPyco/licence.txt b/licence.txt similarity index 100% rename from ProjectPyco/licence.txt rename to licence.txt diff --git a/pyco.cfg b/pyco.cfg deleted file mode 100644 index f08facf..0000000 --- a/pyco.cfg +++ /dev/null @@ -1,3 +0,0 @@ -PathToJar=/home/hhsecond/corenlp -RunServer=java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -url=127.0.0.1:9000 \ No newline at end of file diff --git a/ProjectPyco/pyco/__init__.py b/pyco/__init__.py similarity index 100% rename from ProjectPyco/pyco/__init__.py rename to pyco/__init__.py diff --git a/ProjectPyco/pyco/__main__.py b/pyco/__main__.py similarity index 100% rename from ProjectPyco/pyco/__main__.py rename to pyco/__main__.py diff --git a/ProjectPyco/pyco/pyco.py b/pyco/pyco.py similarity index 100% rename from ProjectPyco/pyco/pyco.py rename to pyco/pyco.py diff --git a/server.sh b/server.sh deleted file mode 100755 index 3311550..0000000 --- a/server.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd /home/hhsecond/corenlp -java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer \ No newline at end of file diff --git a/test/test_pyco_nlp.py b/test/test_pyco_nlp.py deleted file mode 100644 index 7e3b766..0000000 --- a/test/test_pyco_nlp.py +++ /dev/null @@ -1,14 +0,0 @@ -# adding main package path to syspath -import os, sys -path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../core')) -if not path in sys.path: - sys.path.insert(1, path) -del path - - -from pyco_nlp import CoreNLP as cn - -def test_full_annotator_list_len(): - assert len(cn.annotator_full_list) == 14, 'number of full annotator list has been changed, update __init__ ' - -def test_