An application to recommend articles from a Wordpress blog based on user's query using semantic search
Project description
Wordpress articles recommender app using Python
An application to recommend articles from a Wordpress blog based on user's query using semantic search
Pre-requisites:
- Adjust the below environment variables before running any of the below steps if required:
DATA_LOC
: Location where all the application data will be stored. By default, it is stored in adata
folder in the current directory. This folder will be created if it does not exist during creation.- HuggingFace key (free) to use their inference endpoints to generate embeddings using Sentence Transformer models. Export the key to an environment variable called
HF_KEY
before creating or querying the index as shown in the steps below. - Override the default HuggingFace embeddings model by specifying the name in the environment variable
HF_EMBEDDINGS_MODEL_NAME
. If not provided, thesentence-transformers/all-MiniLM-l6-v2
model is used to generate embeddings.
How to use the CLI after installing the package from PyPI:
- Download content:
wordpress-recommender download-content "https://learnwoo.com/post-sitemap1.xml"
- Build index using the downloaded content:
wordpress-recommender generate-index "https://learnwoo.com/post-sitemap1.xml"
- Query index built in previous step:
wordpress-recommender query-index "https://learnwoo.com/post-sitemap1.xml" --query "How are the AI regulations different in different parts of the world?"
Release notes:
0.1.1
- Initial release
0.1.2
- Allow client to override the default HuggingFace inference API embeddings model via the environment variable
HF_EMBEDDINGS_MODEL_NAME
- Allow client to rebuild index by providing the option
--rebuild_index
in the CLI - Breaking change Return final output as a sorted pandas dataframe with all original columns present along with a new column for the score e.g.
cosine_distance
orcosine_similarity
- Allow client to override the number of results returned by passing an optional
--top
parameter with an integer value
0.1.3
- Minor updates to docs
- Add tests
- Add GitHub Actions to publish package
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file wordpress_recommender-0.1.3.tar.gz
.
File metadata
- Download URL: wordpress_recommender-0.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d70d801666854058093c2c7377e4033bd16e6fe31619e5a3dc5b90ed9819c639 |
|
MD5 | 9ecb0110d857b8992c51f95d9fed5931 |
|
BLAKE2b-256 | eb511da583cd01b165a840d63b33a0195311ce451cb7a4cd17516ad2bc27992a |
File details
Details for the file wordpress_recommender-0.1.3-py3-none-any.whl
.
File metadata
- Download URL: wordpress_recommender-0.1.3-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e97fb6a079dab86ef7010c0f40dd7be4aec6e971dc554adc66c34154829649c3 |
|
MD5 | 20393c8d1c0d2191aadfba903ad3efed |
|
BLAKE2b-256 | 7a9bb73353010a73cdd2a3097a03b6d3979a37fa21b9064d0868ae22d2591786 |