{"id":18486092,"url":"https://github.com/mathsgod/semantic-splitter-php","last_synced_at":"2026-02-02T19:38:46.272Z","repository":{"id":248465257,"uuid":"828761478","full_name":"mathsgod/semantic-splitter-php","owner":"mathsgod","description":"This is a simple tool to split a text into sentences by semantic meaning. Each sentence will be grouped together if they have similar meaning. Each sentence should be separated by a newline character.","archived":false,"fork":false,"pushed_at":"2024-07-17T08:48:12.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T16:54:44.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","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/mathsgod.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-07-15T04:42:31.000Z","updated_at":"2025-09-10T10:33:44.000Z","dependencies_parsed_at":"2024-07-15T05:48:40.978Z","dependency_job_id":"34d71caf-f0cc-409a-9a52-007fc9f7a3f0","html_url":"https://github.com/mathsgod/semantic-splitter-php","commit_stats":null,"previous_names":["mathsgod/semantic-splitter-php"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mathsgod/semantic-splitter-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fsemantic-splitter-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fsemantic-splitter-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fsemantic-splitter-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fsemantic-splitter-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathsgod","download_url":"https://codeload.github.com/mathsgod/semantic-splitter-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathsgod%2Fsemantic-splitter-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29018172,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T18:51:31.335Z","status":"ssl_error","status_checked_at":"2026-02-02T18:49:20.777Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-11-06T12:47:47.581Z","updated_at":"2026-02-02T19:38:46.229Z","avatar_url":"https://github.com/mathsgod.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Text Splitter\n\nThis is a simple tool to split a text into sentences by semantic meaning. Each sentence will be grouped together if they have similar meaning. Each sentence should be separated by a newline character.\n\n## Installation\n\n```bash\ncomposer require mathsgod/semantic-splitter-php\n```\n\n## Usage\n\n```php\n\n$splitter = new TextSplitter\\SemanticTextSplitter(new MyEmbeddingRetriever());\n\n$sentences= $splitter-\u003esplit(\"I am a sentence. \nI am another sentence.\nI am a sentence that is a question?\n\n這是一個中文句子。\n這是另一個中文句子。\n\n如果句子意思接近, 這個工具會把他們放在一起。\");\n\nprint_r($sentences);\n\n\n```\n\n/// Output\n```\nArray\n(\n    [0] =\u003e I am a sentence.\nI am another sentence.\nI am a sentence that is a question?\n    [1] =\u003e 這是一個中文句子。\n這是另一個中文句子。\n如果句子意思接近, 這個工具會把他們放在一起。\n如果句子意思不接近, 這個工具會把他們分開。\n作者: 陳大文\n)\n```\n\n\n\n### Embedding retriever\n\nSemantic Text Splitter requires an embedding retriever to work. You can implement your own retriever by implementing the `TextSplitter\\EmbeddingRetrieverInterface` interface.\n\n```php\n\nclass MyEmbeddingRetriever implements TextSplitter\\EmbeddingRetrieverInterface\n{\n    public function getEmbedding(string $text): array\n    {\n        // Implement your own embedding retriever here\n        // for example, you can use OpenAI to get the embedding of the text\n        return [0.1, 0.2, 0.3];\n    }\n}\n\n```\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fsemantic-splitter-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsgod%2Fsemantic-splitter-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsgod%2Fsemantic-splitter-php/lists"}