{"id":19484958,"url":"https://github.com/opencog/relex","last_synced_at":"2025-04-04T16:13:41.642Z","repository":{"id":13809716,"uuid":"16505851","full_name":"opencog/relex","owner":"opencog","description":"English Dependency Relationship Extractor","archived":false,"fork":false,"pushed_at":"2024-12-20T16:15:06.000Z","size":10445,"stargazers_count":85,"open_issues_count":23,"forks_count":68,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-03-28T15:06:47.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://wiki.opencog.org/w/RelEx","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencog.png","metadata":{"files":{"readme":"README-Stanford","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-04T08:05:49.000Z","updated_at":"2024-12-20T16:15:03.000Z","dependencies_parsed_at":"2024-11-10T20:27:07.720Z","dependency_job_id":"e37f571e-2ed8-4727-9b30-00b95e7c7e23","html_url":"https://github.com/opencog/relex","commit_stats":{"total_commits":2490,"total_committers":42,"mean_commits":"59.285714285714285","dds":"0.29518072289156627","last_synced_commit":"7d3df07ded0a49f9a4c639bdc08793e5d13e0da5"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencog%2Frelex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencog%2Frelex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencog%2Frelex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencog%2Frelex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencog","download_url":"https://codeload.github.com/opencog/relex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247208140,"owners_count":20901570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T20:24:53.061Z","updated_at":"2025-04-04T16:13:41.615Z","avatar_url":"https://github.com/opencog.png","language":"Java","funding_links":[],"categories":["人工智能"],"sub_categories":["自然语言处理"],"readme":"\n             Stanford Parser Compatibility Mode\n             ----------------------------------\n                      October 2009\n\nThe Stanford parser provides a defacto standard definition of dependency\nrelations used in parsing.  Relex has a compatibility mode which\nattempts to generate the same output as the Stanford parser.  This is\nan interesting thing to do, for two reasons:\n\n   1) It provides a way of double-checking parse results,\n   2) RelEx is more than three times faster than the \"factored\"\n      version of the Stanford parser, although it is slower than the\n      PCFG version.\n\nThe compatibility mode is currently in \"beta\": it is mostly implemented,\nbut still has a number of rough spots that need work.\n\nCompatibility mode is enabled with the --stanford flag, passed to\nRelationExtractor. So for example, edit \"relation-extractor.sh\"\nand add \"--stanford\" to the command line there.\n\nA set of test sentences, testing operation of the current parser,\nare documented below. An automated test case, testing compatibility,\ncan be run by issueing the command \"ant test\", which will compile and\nrun src/java_test/relex/test/TestStanford.java.\n\nThe current RelEx implementation, and the notes below, are all relative\nto the version of the Stanford parser that is available at the time of\nthis writing.  RelEx is attempting to be functionally compatible, while\nusing the documentation as a guide.  There are a number of areas where\nthe actual operation of the Stanford parser does not match the\ndocumentation for it -- it either fails to generate the markup as\nclaimed, or it generates undocumented dependencies.  Thus, creating\n\"compatibility\" is somewhat of an inexact science. The status of\nvarious test sentences are reviewed below.\n\nNote that compatibility is strongly influenced by the parse ranking\nalgorithm. The Link-Grammar parser often generates several candidate\nparses for a sentence, and then ranks them according to liklihood.\nIt can be configured to use one of several different ranking algorithms.\nThus, the \"top-most\" parse, used by the test case, is subject to change\ndepending on the ranking algorithm. That is, precision (but not recall)\nis strongly dependent on the parse ranking.\n\n\nWhat its not\n------------\nThis mode is NOT an API compatibility. The API's are completely\ndifferent. The compatibility is in the dependencies generated.\n\nMissing at this time is compatible part-of-speech tagging. At this\ntime, RelEx generates much simpler part-of-speech tags, and there has\nbeen no effort made to ensure their accuracy.\n\nRelEx cannot be trained to learn other languages. RelEx is\nhand-crafted, and handles English only. (We have vague plans to do\nbetter someday...)\n\n\nIssues:\n-------\nThe stanford parser has several different operational modes, wherein\nit generates different relations, dependeing on the mode. A fair number\nof the relations, including csubjpass, infmod, pcomp, possessive, punct,\npurpcl, tmod and xcomp, are not generated in the default mode.  At this\ntime RelEx is attempting to be compatible only with the default mode.\n\nAt this time, link-grammar handles conjunctions in a novel way.\nThese are not percolated up to RelEx in a proper manner, and are\nthus are mostly not handled.\n\nSome other rough spots/issues are marked with XXX below.\n\n\nVersion\n-------\nThe current Stanford parser version is labelled as:\n\n    Stanford Lexicalized Parser v1.6.1 - 19 Oct 2008.\n\nThe ruling documentation is taken to be:\n\n   Stanford typed dependencies manual, Marie-Catherine de Marneffe\n   and Christopher D. Manning September 2008, available at:\n   http://nlp.stanford.edu/software/dependencies_manual.pdf\n\nDocumentation for the Penn Tagset can be found at:\nftp://ftp.cis.upenn.edu/pub/treebank/doc/tagguide.ps.gz\nhttp://www.ims.uni-stuttgart.de/projekte/CorpusWorkbench/CQP-HTMLDemo/PennTreebankTS.html\nhttp://www.mozart-oz.org/mogul/doc/lager/brill-tagger/penn.html\nhttp://www.comp.leeds.ac.uk/ccalas/tagsets/upenn.html\nhttp://bulba.sdsu.edu/jeanette/thesis/PennTags.html\n\n\nTest sentences\n--------------\nA list of test sentences, and status. Many/most of these sentences are\ntaken from the examples provided in the Stanford documentation.\nAdditional test sentences can be found in \"TestStanford.java\".\n\nThe parsing of these sentences are tested automatically by running\n\"ant test\", which runs the test case \"TestStanford.java\".\n\nWho invented sliced bread?\n    Stanford output:\n       nsubj(invented-2, Who-1)\n       amod(bread-4, sliced-3)\n       dobj(invented-2, bread-4)\n    RelEx status: OK\n\nJim runs quickly.\n    Stanford output:\n       nsubj(runs-2, Jim-1)\n       advmod(runs-2, quickly-3)\n    RelEx status: OK\n\nThe bird, a robin, sang sweetly.\n    Stanford output:\n       det(bird-2, The-1)\n       nsubj(sang-7, bird-2)\n       det(robin-5, a-4)\n       appos(bird-2, robin-5)\n       advmod(sang-7, sweetly-8)\n    RelEx status: OK\n\nThere is a place we can go.\n    Stanford output:\n       expl(is-2, There-1)\n       det(place-4, a-3)\n       nsubj(is-2, place-4)\n       nsubj(go-7, we-5)\n       aux(go-7, can-6)\n       dep(is-2, go-7)\n    RelEx status:\n       Not testing this sentence, since stanford outputs a\n       \"dep\" which is not documented in thier manual.\n       Other than that, the parse works.\n\nThe linebacker gave the quarterback a push.\n    Stanford output:\n       det(linebacker-2, The-1)\n       nsubj(gave-3, linebacker-2)\n       det(quarterback-5, the-4)\n       iobj(gave-3, quarterback-5)\n       det(push-7, a-6)\n       dobj(gave-3, push-7)\n    RelEx status: OK\n\nHe stood at the goal line.\n    Stanford output:\n       nsubj(stood-2, He-1)\n       det(line-6, the-4)\n       nn(line-6, goal-5)\n       prep_at(stood-2, line-6)\n    RelEx status: OK\n\nShe looks very beautiful.\n    Stanford output:\n       nsubj(looks-2, She-1)\n       advmod(beautiful-4, very-3)\n       acomp(looks-2, beautiful-4)\n    RelEx status: OK\n\nThe accident happened as the night was falling.\n    Stanford output:\n       det(accident-2, The-1)\n       nsubj(happened-3, accident-2)\n       mark(falling-8, as-4)\n       det(night-6, the-5)\n       nsubj(falling-8, night-6)\n       aux(falling-8, was-7)\n       advcl(happened-3, falling-8)\n    RelEx status: OK\n\nIf you know who did it, you should tell the teacher.\n    Stanford output:\n       mark(know-3, If-1)\n       nsubj(know-3, you-2)\n       advcl(tell-10, know-3)\n       nsubj(did-5, who-4)\n       ccomp(know-3, did-5)\n       dobj(did-5, it-6)\n       nsubj(tell-10, you-8)\n       aux(tell-10, should-9)\n       det(teacher-12, the-11)\n       dobj(tell-10, teacher-12)\n    RelEx status: OK\n\nThe man has been killed by the police.\n    Stanford output:\n       det(man-2, The-1)\n       nsubjpass(killed-5, man-2)\n       aux(killed-5, has-3)\n       auxpass(killed-5, been-4)\n       det(police-8, the-7)\n       agent(killed-5, police-8)\n    Relex status: OK.\n    Hmm ... but the above seems broken -- it leaves out \"by\" from the\n    parse, using \"agent\" instead. Very strange! But that's what we'll\n    do too.\n\nEffects caused by the protein are important.\n    Stanford output:\n       nsubj(important-7, Effects-1)\n       partmod(Effects-1, caused-2)\n       det(protein-5, the-4)\n       agent(caused-2, protein-5)\n       cop(important-7, are-6)\n    RelEx status: OK\n\nSam, my brother, has arrived.\n    Stanford output:\n       nsubj(arrived-7, Sam-1)\n       poss(brother-4, my-3)\n       appos(Sam-1, brother-4)\n       aux(arrived-7, has-6)\n    RelEx status: OK\n\nWhat is that?\n    Stanford output:\n       attr(is-2, What-1)\n       nsubj(is-2, that-3)\n    RelEx status: OK\n\nReagan has died.\n    Stanford output:\n       nsubj(died-3, Reagan-1)\n       aux(died-3, has-2)\n    RelEx status: OK\n\nHe should leave.\n    Stanford output:\n       nsubj(leave-3, He-1)\n       aux(leave-3, should-2)\n    RelEx status: OK\n\nKennedy has been killed.\n    Stanford output:\n       nsubjpass(killed-4, Kennedy-1)\n       aux(killed-4, has-2)\n       auxpass(killed-4, been-3)\n    RelEx status: OK\n\nKennedy was killed.\n    Stanford output:\n       nsubjpass(killed-3, Kennedy-1)\n       auxpass(killed-3, was-2)\n    RelEx status: OK\n\nKennedy got killed.\n    Stanford output:\n       nsubjpass(killed-3, Kennedy-1)\n       auxpass(killed-3, got-2)\n    RelEx status: OK\n\nHe says that you like to swim.\n    Stanford output:\n       nsubj(says-2, He-1)\n       complm(like-5, that-3)\n       nsubj(like-5, you-4)\n       ccomp(says-2, like-5)\n       nsubj(swim-7, to-6)\n       ccomp(like-5, swim-7)\n    RelEx status: Not testing. The \"nsubj(swim, to)\" seems insane to me\n      RelEx currently generates aux(swim-7, to-6) which seems\n      reasonable to me.\n\nBill is big.\n    Stanford output:\n       nsubj(big-3, Bill-1)\n       cop(big-3, is-2)\n    RelEx status: OK\n       (This is an example where the use of the predicative adjective\n       would have been more conceptually correct!)\n\nBill is an honest man.\n    Stanford output:\n       nsubj(man-5, Bill-1)\n       cop(man-5, is-2)\n       det(man-5, an-3)\n       amod(man-5, honest-4)\n    RelEx status: OK\n\nWhat she said makes sense.\n    Stanford output:\n       dobj(said-3, What-1)\n       nsubj(said-3, she-2)\n       csubj(makes-4, said-3)\n       dobj(makes-4, sense-5)\n    RelEx status: OK\n\nWhat she said is not true.\n    Stanford output:\n       dobj(said-3, What-1)\n       nsubj(said-3, she-2)\n       csubj(true-6, said-3)\n       cop(true-6, is-4)\n       neg(true-6, not-5)\n    RelEx status: OK\n\nThat she lied was suspected by everyone.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate csubjpass.\n    RelEx status: nominal\n\nWhich book do you prefer?\n    Stanford output:\n       det(book-2, Which-1)\n       dobj(prefer-5, book-2)\n       aux(prefer-5, do-3)\n       nsubj(prefer-5, you-4)\n    RelEx status: OK\n\nThere is a ghost in the room.\n    Stanford output:\n       expl(is-2, There-1)\n       det(ghost-4, a-3)\n       nsubj(is-2, ghost-4)\n       det(room-7, the-6)\n       prep_in(is-2, room-7)\n    RelEx status: OK\n\nI don’t have anything to say.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate infmod.\n    RelEx status: nominal\n\nShe gave me a raise.\n    Stanford output:\n       nsubj(gave-2, She-1)\n       iobj(gave-2, me-3)\n       det(raise-5, a-4)\n       dobj(gave-2, raise-5)\n    RelEx status: OK\n\nForces engaged in fighting after insurgents attacked.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate mark.\n    RelEx status: nominal\n\nThe director is 65 years old.\n    Stanford output:\n       det(director-2, The-1)\n       nsubj(old-6, director-2)\n       cop(old-6, is-3)\n       num(years-5, 65-4)\n       measure(old-6, years-5)\n    RelEx status: OK\n\nSam eats 3 sheep.\n    Stanford output:\n       nsubj(eats-2, Sam-1)\n       num(sheep-4, 3-3)\n       dobj(eats-2, sheep-4)\n    RelEx status: OK\n\nI lost $ 3.2 billion.\n    Stanford output:\n       nsubj(lost-2, I-1)\n       dobj(lost-2, $-3)\n       number($-3, 3.2-4)\n       number($-3, billion-5)\n\n    RelEx status: nominal\n       I don't get it. There's a subtle distinction between num and\n       number that Stanford is making that I dont' understand.  RelEx\n       currently generates:\n          number(billion-5, 3.2-4)\n          num($-3, billion-5)\n       which I think is more correct.\n\nTruffles picked during the spring are tasty.\n    Stanford output:\n       nsubj(tasty-7, Truffles-1)\n       partmod(Truffles-1, picked-2)\n       det(spring-5, the-4)\n       prep_during(picked-2, spring-5)\n       cop(tasty-7, are-6)\n    RelEx status: OK\n\nWe have no information on whether users are at risk.\nThey heard about you missing classes.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate pcomp.\n    RelEx status: nominal\n\nI sat on the chair.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate pobj.\n    RelEx status: nominal\n       Relex is currently producing the same results as Stanford.\n\nWe went to their offices to get Bill's clothes.\n    Stanford output:\n       nsubj(went-2, We-1)\n       xsubj(get-7, We-1)\n       poss(offices-5, their-4)\n       prep_to(went-2, offices-5)\n       aux(get-7, to-6)\n       xcomp(went-2, get-7)\n       poss(clothes-10, Bill-8)\n       dobj(get-7, clothes-10)\n    RelEx status:\nUnder construction:\n       xsubj(get-7, We-1)\n       xcomp(went-2, get-7)\nprep_to2(went-2, get-7)\n\nAll the boys are here.\n    Stanford output:\n       predet(boys-3, All-1)\n       det(boys-3, the-2)\n       nsubj(are-4, boys-3)\n       advmod(are-4, here-5)\n    RelEx status:\n       Predet is generated, as described in stanford docs. However,\n       the copular structure is different. More generally, link\n       grammar treats predeterminers differently (AL link) and\n       this needs some additional resolution. Also, it is not clear\n       to me why Stanford doesn't treat this as being copular, i.e.\n          nsubj(here-5, boys-3)\n          cop(here-5, are-4)\n       the way that it treats other copulas (e.g. \"The garage is\n       next to the house.\" gets nsubj(next-4, garage-2) cop(next-4,\n       is-3).\n\nI saw a cat in a hat.\nI saw a cat with a telescope.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate prep. Instead,\n       Stanford is producing a collapsed prep. Worse, these\n       sentences are ambiguous -- is the cat holding a telescope,\n       or am I looking through one?  The top-ranked parses for\n       RelEx indicate that the seeing is doine through the telescope\n       (and that the seeing is done while wearing a hat). By contrast,\n       Stanford currently presumes that the cat has a hat, and a\n       telescope -- these parses are generated by RelEx, but are\n       ranked lower.\n    RelEx status: OK\n\nHe is responsible for meals.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate prep. Instead,\n       stanford is producing a collapsed prep.\n    RelEx status: OK\n       i.e. RelEx is producing the same thing as Stanford at this time.\n\nThey shut down the station.\n    Stanford output:\n       nsubj(shut-2, They-1)\n       prt(shut-2, down-3)\n       det(station-5, the-4)\n       dobj(shut-2, station-5)\n    RelEx status: OK\n\nGo home!\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate punct.\n    RelEx status: nominal\n\nHe talked to him in order to secure the account.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate purpcl.\n    RelEx status: nominal\n        xxx relex gets xcomp wrong here, and needs an xsubj\n\nAbout 200 people came to the party.\n    Stanford output:\n       quantmod(200-2, About-1)\n       num(people-3, 200-2)\n       nsubj(came-4, people-3)\n       det(party-7, the-6)\n       prep_to(came-4, party-7)\n    RelEx status: OK\n\nI saw the book which you bought.\n    Stanford output:\n       Stanford is not outputting what the documentation says it\n       should -- it was supposed to illustrate ref. Instead, it\n       is generating rel, exactly the same as below. No surprise,\n       since syntactically, these sentences are identical.\n    RelEx status: OK\n       (I.e. relex is generatng exactly the same thing as the\n       stanford parser currently is.)\n\nI saw the man who you love.\n    Stanford output:\n       nsubj(saw-2, I-1)\n       det(man-4, the-3)\n       dobj(saw-2, man-4)\n       dobj(love-7, man-4)\n       rel(love-7, who-5)\n       nsubj(love-7, you-6)\n       rcmod(man-4, love-7)\n    RelEx status: OK\n\nI saw the man whose wife you love.\n    Stanford output:\n       nsubj(saw-2, I-1)\n       det(man-4, the-3)\n       dobj(saw-2, man-4)\n       poss(wife-6, whose-5)\n       dobj(love-8, wife-6)\n       rel(love-8, wife-6)\n       nsubj(love-8, you-7)\n       rcmod(man-4, love-8)\n    RelEx status: Incomplete\n      Not yet generating the rel and the rcmod. under construction.\n      shouldn't be hard ...\n\nLast night, I swam in the pool.\n    Stanford output:\n       (Stanford is not outputting what the documentation says it\n        should -- it was supposed to illustrate tmod.)\n    RelEx status: nominal\n\nHe says that you like to swim.\n    Stanford output:\n       (Stanford is not outputting what the documentation says it\n        should -- it was supposed to illustrate xcomp.)\n    RelEx status: nominal\n\nI am ready to leave.\n    Stanford output:\n       nsubj(ready-3, I-1)\n       cop(ready-3, am-2)\n       aux(leave-5, to-4)\n       xcomp(ready-3, leave-5)\n    RelEx status: OK\n\nTom likes to eat fish.\n    Stanford output:\n       nsubj(likes-2, Tom-1)\n       xsubj(eat-4, Tom-1)\n       aux(eat-4, to-3)\n       xcomp(likes-2, eat-4)\n       dobj(eat-4, fish-5)\n    RelEx status: OK\n\n\nUnder construction:\n\nThe garage is next to the house.\n    Stanford output:\n       det(garage-2, The-1)\n       nsubj(next-4, garage-2)\n       cop(next-4, is-3)\n       det(house-7, the-6)\n       prep_to(next-4, house-7)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencog%2Frelex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencog%2Frelex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencog%2Frelex/lists"}