{"id":15129836,"url":"https://github.com/zefrenchwan/recueil","last_synced_at":"2026-01-18T17:33:22.231Z","repository":{"id":256742220,"uuid":"856241313","full_name":"zefrenchwan/recueil","owner":"zefrenchwan","description":"API to type words (\"Paris\" -\u003e \"city\")","archived":false,"fork":false,"pushed_at":"2024-09-29T20:45:07.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T19:18:58.553Z","etag":null,"topics":["docker-compose","falcon","mit-license","postgresql","python3","referential"],"latest_commit_sha":null,"homepage":"","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/zefrenchwan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T08:32:46.000Z","updated_at":"2024-09-29T20:45:10.000Z","dependencies_parsed_at":"2024-10-31T10:44:00.060Z","dependency_job_id":"fef7c51e-67dc-49df-a712-305557e6c7c0","html_url":"https://github.com/zefrenchwan/recueil","commit_stats":null,"previous_names":["zefrenchwan/recueil"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zefrenchwan/recueil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Frecueil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Frecueil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Frecueil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Frecueil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefrenchwan","download_url":"https://codeload.github.com/zefrenchwan/recueil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefrenchwan%2Frecueil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28544886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker-compose","falcon","mit-license","postgresql","python3","referential"],"created_at":"2024-09-26T02:21:13.442Z","updated_at":"2026-01-18T17:33:22.216Z","avatar_url":"https://github.com/zefrenchwan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# recueil\n\nAPI to type words (\"Paris\" -\u003e \"city\")\n\nCopyright zefrenchwan, 2024\nMIT license\n\n## TLDR\n\n1. Webapp to get and put data you ask for. Not just a cache, there is type inheritance and type inference\n2. Put data in bootstrap folder, change my config if necessary\n3. Create an env file and put values for `DBUSER`, `DBPASS` and `DBNAME`\n4. Launch `deploy.sh`\n5. Use it, for instance: `curl http://localhost:8000/check/value/paris/as/city/`  \n\n\n## What would be the typical use case for this project ? \n\n1. Data recognition for some specific values. You may want precise, hard coded results sometimes because your model is not always sufficient \n2. Looking for typed values, because usually you know the type of a data. \n\n### Improve recognition of specific tokens \nNLP models (spaCy for instance) tend to learn from corpus and then recognize what *looks like* a named entity. \nIt usually is good enough. \nBut when a company claims to be an expert of a given field, not finding or not typing common knowledge is a real issue. \nFor instance, you may want to recognize \"Michel Barnier\" as a french prime minister when your job is social network analysis applied to politics. \nTo do so, a model is not sufficient. \nYou need a tool that contains \"hard coded information\": \n* named entities on a specific field \n* specific values (first names usually used)\n\n### Typed searches\n\nAssume you ask for a word, \"Paris\" for instance. \nIt matches the first name of a famous american person, a city in France, music albums, etc. \nWhy would you load all those entries when you know that you ask for a city ? \nIt sounds like a better option to look for `/check/value/Paris/as/CITY/` than `/check/value/Paris/` and then filter on the client side. \nStill, we may do better. \nParis is a capital city, then a city, then a location, then a physical entity. \nWhen asking for locations, you do not want to request `location`, and `city` and `capital` and ... \nYou want to receive cities when asked for locations because cities are a sort of location. \n\n## How do I run it ? \n\n1. create a `.env` file at the same level as the Dockerfile\n2. Set in there `DBUSER` and `DBPASS` for auth, `DBNAME` for database name\n3. Run script `./deploy.sh`\n\n### Available endpoints\n\n1. `/check/value/{value}/` will return information for that value, no matter the type \n2. `/check/value/{value}/as/{tag}/` will return information for that value, filtered as instances of `tag` or its subclasses\n3. `/add/value/{value}/as/{tag}/` will add `value` as `tag`. It changes values, not the inheritance tree. Tag may be stored if not already here\n4. `/link/child/{child}/to/parent/{parent}/` will add the link child -\u003e parent, may add child or parent if not already inserted\n\n### I want custom data, not an empty database\n\nSure ! \nSimple, there is a `bootstrap` folder that contains csv files and json files. \nPut your data in it:\n* in `json` files, follow the example structure to add your own data, note that `content` is an object\n* in `csv` files, put your own inheritance tree. Structure is parent then child, left blanks mean 'same as the upper line' \n\n\n## FAQ / Comments\n\n### Is it prod ready ? \n\nNope, because rebooting means losing all pg data. \nIt is useful for me to test my code, not useful at all for you.\nSo, that would be the first change you want to make. \nThen, security audit. \nSo far, there is no auth at all. \nYou may want to secure this data\n\n### I want to export data once registered in the database\n\nProbably not. \nYou want to change the docker file to keep the stored data. \nMy project is a POC, yours may not be. \n\n\n### You said that using NLP models is not a good thing ! \n\nNo, I did not, calm down. \nI said that models are good, they adapt to new information when a hard code reference data tool will not. \nStill, humans share a common basic knowledge about some named entities. \nThis project may be combined to a model, to detect specific values. \nIt will not replace a model, unless you work on a given specific corpus. \n\n### Why python ? It is way too slow for my super fast project \n\n1. First, because I like Python, and you may want to copy my design for your super fast project. This is why I used MIT license. \n2. You may want to deploy more instances, or cache data. There are solutions for this issue. \n3. I work on a problem, and I try code based solutions. Consider this code as a POC, not a final prod ready code\n\n### Wait, there is no ORM ?\n\nThis is a good question. \nTo me, coding in SQL with low-level access is really efficient and not that difficult. \nSo, you will find stored procedures and all a database may offer. \nNo ORM, then. \n\n\n### Dude, come on, use a graph database ! \n\nSo far, the one I used was slower than my beloved postgresql. \n\n\n### Dude, come on, use a cache ! \n\nMight be an idea, but you would need to store the tree as is. \nInteresting, maybe on a next project ! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefrenchwan%2Frecueil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefrenchwan%2Frecueil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefrenchwan%2Frecueil/lists"}