# Installation
### Install from pip3
```
pip3 install --verbose sencore
```
### Install spacy lib
```
python -m spacy download en_core_web_trf
python -m spacy download es_dep_news_trf
```
# Usage
Please refer to [api docs](https://qishe-nlp.github.io/sencore/).
### Executable usage
* Parse sentence into vocabs
```
parse2vocab --lang en --sentence "It is a great day."
```
* Parse sentence into phrases
```
parse2phrase --lang en --sentence "It is a great day."
```
### Package usage
* Parse sentence into vocabs
```
from sencore import VocabParser
def vocab(lang, sentence):
sentences = {
"en": "Apple is looking at buying U.K. startup for $1 billion.",
"es": "En 1941, fue llamado a filas para incorporarse a la Armada.",
"de": "Für Joachim Löw ist ein Nationalmannschafts-Comeback von Thomas Müller und Mats Hummels nicht mehr kategorisch ausgeschlossen.",
"fr": "Nos jolis canards vont-ils détrôner les poules, coqueluches des jardiniers ?",
}
sen = sentence or sentences[lang]
print(sen)
vp = VocabParser(lang)
vocabs = vp.digest(sen)
print(vocabs)
```
* Parse sentence into phrases
```
from sencore import PhraseParser
def phrase(lang, sentence):
sentences = {
"en": "Apple is looking at buying U.K. startup for $1 billion.",
"es": "En 1941, fue llamado a filas para incorporarse a la Armada.",
"de": "Für Joachim Löw ist ein Nationalmannschafts-Comeback von Thomas Müller und Mats Hummels nicht mehr kategorisch ausgeschlossen.",
"fr": "Nos jolis canards vont-ils détrôner les poules, coqueluches des jardiniers ?",
}
sen = sentence or sentences[lang]
print(sen)
pp = PhraseParser(lang)
phrases = pp.digest(sen)
print(phrases)
```
# Development
### Clone project
```
git clone https://github.com/qishe-nlp/sencore.git
```
### Install [poetry](https://python-poetry.org/docs/)
### Install dependencies
```
poetry update
python -m spacy download en_core_web_trf
python -m spacy download es_dep_news_trf
```
### Test
```
poetry run pytest -rP
```
which run tests under `tests/*`
### Execute
```
poetry run parse_to_vocab --help
```
### Create sphinx docs
```
poetry shell
cd apidocs
sphinx-apidoc -f -o source ../sencore
make html
python -m http.server -d build/html
```
### Host docs on github pages
```
cp -rf apidocs/build/html/* docs/
```
### Build
* Change `version` in `pyproject.toml` and `sencore/__init__.py`
* Build python package by `poetry build`
### Git commit and push
### Publish from local dev env
* Set pypi test environment variables in poetry, refer to [poetry doc](https://python-poetry.org/docs/repositories/)
* Publish to pypi test by `poetry publish -r test`
### Publish through CI
* Github action build and publish package to [test pypi repo](https://test.pypi.org/)
```
git tag [x.x.x]
git push origin master
```
* Manually publish to [pypi repo](https://pypi.org/) through [github action](https://github.com/qishe-nlp/sencore/actions/workflows/pypi.yml)
Raw data
{
"_id": null,
"home_page": "https://github.com/qishe-nlp/sencore",
"name": "sencore",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "NLP, sentence parsing, spacy",
"author": "Phoenix Grey",
"author_email": "phoenix.grey0108@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c8/b5/899473d0c7be37dfde6ef0fd4b39b443f313bead988bc8a0847943019eb5/sencore-0.1.49.tar.gz",
"platform": null,
"description": "# Installation \n\n### Install from pip3\n``` \npip3 install --verbose sencore\n```\n\n### Install spacy lib\n```\npython -m spacy download en_core_web_trf\npython -m spacy download es_dep_news_trf\n```\n\n# Usage\n\nPlease refer to [api docs](https://qishe-nlp.github.io/sencore/).\n\n### Executable usage\n* Parse sentence into vocabs\n\n ```\n parse2vocab --lang en --sentence \"It is a great day.\"\n ```\n\n* Parse sentence into phrases\n\n ```\n parse2phrase --lang en --sentence \"It is a great day.\"\n ```\n\n### Package usage\n* Parse sentence into vocabs\n\n ```\n from sencore import VocabParser \n\n def vocab(lang, sentence):\n sentences = {\n \"en\": \"Apple is looking at buying U.K. startup for $1 billion.\",\n \"es\": \"En 1941, fue llamado a filas para incorporarse a la Armada.\",\n \"de\": \"F\u00fcr Joachim L\u00f6w ist ein Nationalmannschafts-Comeback von Thomas M\u00fcller und Mats Hummels nicht mehr kategorisch ausgeschlossen.\",\n \"fr\": \"Nos jolis canards vont-ils d\u00e9tr\u00f4ner les poules, coqueluches des jardiniers ?\",\n }\n\n sen = sentence or sentences[lang]\n print(sen)\n vp = VocabParser(lang)\n vocabs = vp.digest(sen)\n print(vocabs)\n\n ```\n\n* Parse sentence into phrases\n\n ```\n from sencore import PhraseParser\n\n def phrase(lang, sentence):\n sentences = {\n \"en\": \"Apple is looking at buying U.K. startup for $1 billion.\",\n \"es\": \"En 1941, fue llamado a filas para incorporarse a la Armada.\",\n \"de\": \"F\u00fcr Joachim L\u00f6w ist ein Nationalmannschafts-Comeback von Thomas M\u00fcller und Mats Hummels nicht mehr kategorisch ausgeschlossen.\",\n \"fr\": \"Nos jolis canards vont-ils d\u00e9tr\u00f4ner les poules, coqueluches des jardiniers ?\",\n }\n\n sen = sentence or sentences[lang]\n print(sen)\n pp = PhraseParser(lang)\n phrases = pp.digest(sen)\n print(phrases)\n ```\n\n# Development\n\n### Clone project\n```\ngit clone https://github.com/qishe-nlp/sencore.git\n```\n\n### Install [poetry](https://python-poetry.org/docs/)\n\n### Install dependencies\n```\npoetry update\npython -m spacy download en_core_web_trf\npython -m spacy download es_dep_news_trf\n```\n\n### Test\n```\npoetry run pytest -rP\n```\nwhich run tests under `tests/*`\n\n\n### Execute\n```\npoetry run parse_to_vocab --help\n```\n\n### Create sphinx docs\n```\npoetry shell\ncd apidocs\nsphinx-apidoc -f -o source ../sencore\nmake html\npython -m http.server -d build/html\n```\n\n### Host docs on github pages\n```\ncp -rf apidocs/build/html/* docs/\n```\n\n### Build\n* Change `version` in `pyproject.toml` and `sencore/__init__.py`\n* Build python package by `poetry build`\n\n### Git commit and push\n\n### Publish from local dev env\n* Set pypi test environment variables in poetry, refer to [poetry doc](https://python-poetry.org/docs/repositories/)\n* Publish to pypi test by `poetry publish -r test`\n\n### Publish through CI \n\n* Github action build and publish package to [test pypi repo](https://test.pypi.org/)\n\n```\ngit tag [x.x.x]\ngit push origin master\n```\n\n* Manually publish to [pypi repo](https://pypi.org/) through [github action](https://github.com/qishe-nlp/sencore/actions/workflows/pypi.yml)\n\n",
"bugtrack_url": null,
"license": null,
"summary": "sentence nlp parser for multilingua",
"version": "0.1.49",
"project_urls": {
"Documentation": "https://qishe-nlp.github.io/sencore/",
"Homepage": "https://github.com/qishe-nlp/sencore",
"Repository": "https://github.com/qishe-nlp/sencore"
},
"split_keywords": [
"nlp",
" sentence parsing",
" spacy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d9f5d6c2fde9ac96e7044119dc3d0b83e75dac5e74280bf91b305ab161b008ee",
"md5": "cca41e6c6d0d6057ebd15f67ef2e7762",
"sha256": "9b4cd84c22430690fec53ba35960ac8d0fbf9a54f0126a0231b220069dbf8801"
},
"downloads": -1,
"filename": "sencore-0.1.49-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cca41e6c6d0d6057ebd15f67ef2e7762",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 13083,
"upload_time": "2025-01-21T03:09:27",
"upload_time_iso_8601": "2025-01-21T03:09:27.641045Z",
"url": "https://files.pythonhosted.org/packages/d9/f5/d6c2fde9ac96e7044119dc3d0b83e75dac5e74280bf91b305ab161b008ee/sencore-0.1.49-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c8b5899473d0c7be37dfde6ef0fd4b39b443f313bead988bc8a0847943019eb5",
"md5": "eba22f3ba42db337f94b5f9fcdd4ff20",
"sha256": "55c05248657712a9ae65e4787cd5ca3661d924ed068534bb7101fff7a785f98b"
},
"downloads": -1,
"filename": "sencore-0.1.49.tar.gz",
"has_sig": false,
"md5_digest": "eba22f3ba42db337f94b5f9fcdd4ff20",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 8972,
"upload_time": "2025-01-21T03:09:29",
"upload_time_iso_8601": "2025-01-21T03:09:29.399278Z",
"url": "https://files.pythonhosted.org/packages/c8/b5/899473d0c7be37dfde6ef0fd4b39b443f313bead988bc8a0847943019eb5/sencore-0.1.49.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-21 03:09:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "qishe-nlp",
"github_project": "sencore",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sencore"
}