{"analyzedAt":"2022-06-26T21:03:51.050Z","collected":{"metadata":{"name":"slot-filler","scope":"unscoped","version":"1.0.6","description":"Fill in the slots in a phrase template given a matching phrase.","keywords":["slot","filler","word","alignment","sentence"],"date":"2017-05-04T18:43:21.453Z","author":{"name":"John Loverich"},"publisher":{"username":"jloveric","email":"ninfcs@gmail.com"},"maintainers":[{"username":"jloveric","email":"ninfcs@gmail.com"}],"repository":{"type":"git","url":"git+https://github.com/jloveric/SlotFiller.git"},"links":{"npm":"https://www.npmjs.com/package/slot-filler"},"license":"MIT","dependencies":{"clone":"^2.1.1","debug":"^2.6.6","helper-clockmaker":"^1.0.3","sentence-similarity":"^1.0.3"},"devDependencies":{"jasmine":"^2.6.0","jasmine-spec-reporter":"^4.1.0"},"releases":[{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2020-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0}],"hasTestScript":true,"readme":"# SlotFiller\nslot-filler is used in combination with sentence-similarity to fill in slots.  Slots are defined using a phrase template such as \"What (keyword) is the (item) in?\".  The slot-filler can then take a sentence such as \"Hi, what aisle is the bacon in?\" and fill in the slots keyword=\"aisle\" and item = \"bacon\".  The slot filler will often work even when the sentence does not exactly match the phrase template including when words are missing, added or misspelled.  A user defined word similarity measure give the user flexibility, one could even include a synonym search in the word similarity measure if desired.  The slot-filler is used as part of the clockmaker bot framework (in the process of release).\n\n# Example 1, exact match\n\n```javascript\nlet slotFiller = require('slot-filler')\nlet ss = require('sentence-similarity')\n\nlet stdOpts = { f: ss.similarityScore.metaphoneDl, options : {threshold: 0.3} }\n\nlet a = ['Hello', 'my', 'name', 'is', 'John', 'Jacob']\nlet b = ['Hello', '(pronoun)', 'name', 'is', '(name)']\nlet ans = ss.sentenceSimilarity(a,b,stdOpts) \t\n\nconsole.log(ans)\n\nlet slots = slotFiller.getWildcards(b, a, ans.matched, null)\nconsole.log(slots)\n```\ngives output\n```json\n{ wildcards: { matched: true, pronoun: 'my', name: 'John Jacob' },\n  score: { score: 1, count: 2 } }\n```\nso that now the slotFiller has estimated the slots for (pronoun) and\n(name).  Note, the names inside the wildcards (pronoun),(name) are arbitrary,\nthe slotFiller would not behave any differently if the names were changed.\n\n# Example 2, inexact match\nThe template sentence does not need to exactly match the stated sentence, but the slot-filler\nwill try and figure out the correct slots anyway.  This can help you from having to state every\nvariation of a given template.\n\n```javascript\nlet slotFiller = require('slot-filler')\nlet ss = require('sentence-similarity')\n\nlet a = ['my', 'is', 'John', 'Jacob']\nlet b = ['Hello,', '(pronoun)', 'name', 'is', '(name)']\nlet ans = ss.sentenceSimilarity(a,b,stdOpts) \t\n\nlet slots = slotFiller.getWildcards(b, a, ans.matched, null)\nconsole.log(slots)\n```\nproduces\n```json\n{ wildcards: { matched: true, pronoun: 'my', name: 'John Jacob' },\n  score: { score: 1, count: 2 } }\n```\n\n# Example 3, reconstruction\nGiven a phrase with slots and a set of slot values, the slot filler can also fill\nin the slots\n\n```javascript\nlet slotFiller = require('slot-filler')\n\nlet wc = {pronoun : \"your\", name : \"kai\"}\nlet phrase = 'Hello, (pronoun) name is (name)'\n\t\nlet res = slotFiller.reconstructPhrase(phrase, wc)\nconsole.log(res)\n```\nproduces\n```json\n{ phrase: 'Hello, your name is kai', success: true, score: 2 }\n```"},"npm":{"downloads":[{"from":"2022-06-25T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-06-19T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":3},{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":27},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":149},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":399},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":747}],"starsCount":0},"github":{"starsCount":2,"forksCount":0,"subscribersCount":2,"issues":{"count":1,"openCount":1,"distribution":{"3600":0,"10800":0,"32400":0,"97200":0,"291600":0,"874800":0,"2624400":0,"7873200":0,"23619600":0,"70858800":0,"212576400":1},"isDisabled":false},"contributors":[{"username":"jloveric","commitsCount":27}],"commits":[{"from":"2022-06-19T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-05-27T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2022-03-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-12-28T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0},{"from":"2021-06-26T00:00:00.000Z","to":"2022-06-26T00:00:00.000Z","count":0}],"statuses":[{"context":"continuous-integration/travis-ci/push","state":"success"}]},"source":{"files":{"readmeSize":2648,"testsSize":1755},"outdatedDependencies":{"sentence-similarity":{"required":"^1.0.3","stable":"3.0.2","latest":"3.0.2"},"debug":{"required":"^2.6.6","stable":"4.3.4","latest":"4.3.4"}}}},"evaluation":{"quality":{"carefulness":0.71,"tests":0.85,"health":0.5,"branding":0},"popularity":{"communityInterest":5,"downloadsCount":49.666666666666664,"downloadsAcceleration":-0.24412100456621,"dependentsCount":0},"maintenance":{"releasesFrequency":0.9,"commitsFrequency":0.9,"openIssues":0.9,"issuesDistribution":0.9}},"score":{"final":0.5966971032903672,"detail":{"quality":0.7831698456852243,"popularity":0.03367959342747392,"maintenance":0.9998808339576686}}}