# 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": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "NLP,sentence parsing,spacy",
"author": "Phoenix Grey",
"author_email": "phoenix.grey0108@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c9/15/bcd2d362b8fc3d4846c6dd816f73e80a27c6083df50e205e6c345ce2d2c8/sencore-0.1.39.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": "",
"summary": "sentence nlp parser for multilingua",
"version": "0.1.39",
"split_keywords": [
"nlp",
"sentence parsing",
"spacy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "baf23808b0d3e2ad5326291aedf2aef7ba761ee4fd8b11a12465ac15634bbfca",
"md5": "2db40865030a5e03f491a40d8e182770",
"sha256": "70042c05ad1efa2b85b3b1f10b0c2bf90f824f6b1e69fa8da7a9f8bf980b4b29"
},
"downloads": -1,
"filename": "sencore-0.1.39-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2db40865030a5e03f491a40d8e182770",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 8408,
"upload_time": "2023-03-30T04:40:07",
"upload_time_iso_8601": "2023-03-30T04:40:07.629154Z",
"url": "https://files.pythonhosted.org/packages/ba/f2/3808b0d3e2ad5326291aedf2aef7ba761ee4fd8b11a12465ac15634bbfca/sencore-0.1.39-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c915bcd2d362b8fc3d4846c6dd816f73e80a27c6083df50e205e6c345ce2d2c8",
"md5": "7d6a4d147c72b32bb755db6ba1d42979",
"sha256": "529e4a672ee43b47d3e78fe0d0fb7655f0bb69c8468fbe5be8b2f6551add7116"
},
"downloads": -1,
"filename": "sencore-0.1.39.tar.gz",
"has_sig": false,
"md5_digest": "7d6a4d147c72b32bb755db6ba1d42979",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 5760,
"upload_time": "2023-03-30T04:40:09",
"upload_time_iso_8601": "2023-03-30T04:40:09.325973Z",
"url": "https://files.pythonhosted.org/packages/c9/15/bcd2d362b8fc3d4846c6dd816f73e80a27c6083df50e205e6c345ce2d2c8/sencore-0.1.39.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-30 04:40:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "qishe-nlp",
"github_project": "sencore",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "sencore"
}