Common Phrase Detection
This is an API python library which is developed for detecting stop phrases.
Table of Contents
Background
NLP (Natural Language Processing) techniques is very helpful in various applications such as sentiment analysis, chatbots and other areas. For developing NLP models a need for a large & clean corpus for learning words relations is indisputable. One of the challanges in achieving a clean corpus is stop phrases. Stop phrases usually does not contain much information about the text and so must be identified and removed from the text.
This is the aim of this repo to provide a structure for processing HTML pages (which are a valuable source of text for all languages) and finding a certain number of possible combinations of words and using human input for identifying stop phrases.
Install
-
Make sure you have
docker,docker-composeandpython 3.8and above installed. -
create a
.envfile with desired values based on.env.examplefile. -
After cloning the project, go to the project directory and run below command.
docker-compose -f docker-compose-dev.yml build
- After the images are built successfully, run below command for starting the project.
docker-compose -f docker-compose-dev.yml up -d
- We need to create a database and collection in mongo in order to use the API. First run mongo bash.
docker exec -it db bash
- Authenticate in mongo container.
mongo -u ${MONGO_INITDB_ROOT_USERNAME} -p ${MONGO_INITDB_ROOT_PASSWORD} -- authenticationDatabase admin
- Create the database and collection based on
MONGO_PHRASE_DBandMONGO_PHRASE_COLnames you provided in step2.
use phrasedb; # Database creation
db.createCollection("common_phrase"); # Collection creation
- Now you're ready yo use the API section.
API
This API has three endpoints.
Document Process
Here you can pass a HTML text in request body to process it.
The process stages are:
-
Fetching all H1-H6 and p tags
-
Cleaning text
-
Finding bags (from 1 to 5 bags of word)
-
Counting the number of occurences in text
-
Integrating results in database (Updating count field of the phrase if already exists, otherwise inserting a new record)
Status Updater
Updates statuses.
Changing the status of a phrase to either stop or highlight.
Data Fetcher
Fetching data from database based on the statuses. Here you can fetch phrases based on 4 different situation for statuses:
-
Stop phrases
-
Highlight phrases
-
Phrases that have status (either stop or highlight)
-
Phrases which statuses are not yet determined
API details
- API Base URL
127.0.0.1:8000
- API Swagger UI
127.0.0.1:8000/docs
For futher details and how to make request to each endpoint refer to the swagger of the API.
Maintainers
Metadata
Release files for phrase-counter 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phrase_counter-0.2.6.tar.gz | 19.4 kB | Without provenance | Details for phrase_counter-0.2.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phrase_counter-0.2.6-py3-none-any.whl | Python 3 | none | any | Details for phrase_counter-0.2.6-py3-none-any.whl |
Total release size: 35.7 kB
Release files / phrase_counter-0.2.6.tar.gz
| Download URL | phrase_counter-0.2.6.tar.gz |
|---|---|
| Size | 19.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4be023e51a985d3379c07ccba02b9b85eec8e5efcf9bc5531de878c16ea4b814
|
|
BLAKE2b-256 checksum How to use checksums |
231c249830e689ab1188a153b40936676c980c95be931e7fa46b1a7d776d83a5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / phrase_counter-0.2.6-py3-none-any.whl
| Download URL | phrase_counter-0.2.6-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5a869dd60d96bdc8fb303b412564b96f970a89077052f5c9238f260b4c13bbe
|
|
BLAKE2b-256 checksum How to use checksums |
4f5855e094310ac711acb343f98f7250427338b9097c1fd86b6c42f97bceec67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for phrase-counter 0.2.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.