{"id":19784054,"url":"https://github.com/openeventdata/hypnos","last_synced_at":"2025-04-30T22:31:59.380Z","repository":{"id":52705228,"uuid":"62404844","full_name":"openeventdata/hypnos","owner":"openeventdata","description":"RESTful API around the PETRARCH coding software","archived":false,"fork":false,"pushed_at":"2021-04-20T17:17:44.000Z","size":20,"stargazers_count":10,"open_issues_count":7,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T05:34:32.002Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openeventdata.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-01T16:08:34.000Z","updated_at":"2023-06-07T16:55:34.000Z","dependencies_parsed_at":"2022-08-21T19:20:20.942Z","dependency_job_id":null,"html_url":"https://github.com/openeventdata/hypnos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeventdata%2Fhypnos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeventdata%2Fhypnos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeventdata%2Fhypnos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openeventdata%2Fhypnos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openeventdata","download_url":"https://codeload.github.com/openeventdata/hypnos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251791718,"owners_count":21644447,"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-12T06:10:12.581Z","updated_at":"2025-04-30T22:31:59.143Z","avatar_url":"https://github.com/openeventdata.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Circle CI](https://circleci.com/gh/caerusassociates/hypnos.svg?style=svg)](https://circleci.com/gh/caerusassociates/hypnos)\n[![Code Health](https://landscape.io/github/openeventdata/hypnos/petrarch2/landscape.svg?style=flat)](https://landscape.io/github/openeventdata/hypnos/petrarch2)\n\nhypnos\n======\n\n**Note: hypnos now works with PETRARCH2 by default.**\n\nA RESTful API around the [PETRARCH2](https://github.com/openeventdata/petrarch2)\nevent data coder. Using `docker compose`, this setup also integrates the \nStanford [CoreNLP](http://nlp.stanford.edu/software/corenlp.shtml) parser\nusing Casey Hilland's [docker container](https://github.com/chilland/ccNLP).\nThis setup allows the users to stream texts into the API, rather than the \nbatch mode seen in applications such as the [Phoenix pipeline](https://github.com/openeventdata/phoenix_pipeline).\n\nThis software was developed by Caerus Associates and donated to the Open Event\nData Alliance.\n\nRunning\n-------\n\nRunning the system is as simple as `cd`ing into the `hypnos` directory and using\n\n`docker-compose up`\n\nor \n\n`docker-compose up -d`\n\nto run in the background.\n\nThis assumes that you have `docker-compose` and `docker` installed.\n\nExample Python Usage\n-----\n\n```\nimport requests\nimport json \nfrom pprint import pprint\n\nheaders = {'Content-Type': 'application/json'}\ndata = {'text':\"A Tunisian court has jailed a Nigerian student for two years for helping young militants join an armed Islamic group in Lebanon, his lawyer said Wednesday.\", 'id': 'abc123', 'date':'20010101'}\ndata = json.dumps(data)\nr = requests.get('http://localhost:5002/hypnos/extract', data=data, headers=headers)\npprint(r.json())\n```\n\nReturns:\n\n```\n{'abc123': {'meta': {'date': '20010101', 'verbs': []},\n            'sents': {'0': {'content': 'A Tunisian court has jailed a Nigerian '\n                                       'student for two years for helping '\n                                       'young militants join an armed Islamic '\n                                       'group in Lebanon , his lawyer said '\n                                       'Wednesday .',\n                            'events': [['TUNJUD', 'NGAEDU', '173']],\n                            'issues': [['STUDENTS', 1],\n                                       ['NAMED_TERROR_GROUP', 1]],\n                            'meta': {'actorroot': [['', '']],\n                                     'actortext': [['Tunisian court',\n                                                    'Nigerian student']],\n                                     'eventtext': ['has jailed'],\n                                     'nouns': [[[' TUNISIAN', ' COURT'],\n                                                ['TUNJUD'],\n                                                [['TUN', []], ['~']]],\n                                               [[' NIGERIAN', ' STUDENT'],\n                                                ['NGAEDU'],\n                                                [['NGA', []], ['~']]],\n                                               [[' ARMED ISLAMIC GROUP'],\n                                                ['DZAREB'],\n                                                [['DZAREB', []]]],\n                                               [[' LEBANON'],\n                                                ['LBN'],\n                                                [['LBN', []]]],\n                                               [[' LAWYER'],\n                                                ['~JUD'],\n                                                [['~']]]]},\n                            'parsed': '(SBAR (S (NP (DT A )  (JJ TUNISIAN )  '\n                                      '(NN COURT )  )  (VP (VBZ HAS )  (VP '\n                                      '(VBN JAILED )  (NP (DT A )  (JJ '\n                                      'NIGERIAN )  (NN STUDENT )  )  (PP (IN '\n                                      'FOR )  (NP (CD TWO )  (NNS YEARS )  )  '\n                                      ')  (PP (IN FOR )  (S (VP (VBG HELPING '\n                                      ')  (NP (JJ YOUNG )  (NNS MILITANTS )  '\n                                      ')  )  )  )  )  )  )  (S (VP (VBP JOIN '\n                                      ')  (NP (DT AN )  (JJ ARMED )  (JJ '\n                                      'ISLAMIC )  (NN GROUP )  )  (PP (IN IN '\n                                      ')  (NP (NNP LEBANON )  )  )  )  )  (, , '\n                                      ')  (S (NP (PRP$ HIS )  (NN LAWYER )  )  '\n                                      '(VP (VBD SAID )  (NP (NNP WEDNESDAY )  '\n                                      ')  )  )  (. . )  )  '}}}}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopeneventdata%2Fhypnos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopeneventdata%2Fhypnos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopeneventdata%2Fhypnos/lists"}