Skip to content

moz-sec/faq-search

Repository files navigation

faq-search

Lang MIT License Code style: black Linting: Ruff codecov

faq-search is FAQ search system.

Description

faq-search is a system that searches for FAQs. This repository uses the FAQ dataset provided by LINE Corporation. Faiss (Facebook AI Similarity Search) developed by Facebook, identifies questions that are similar to the query and outputs an Answer.

Article on LINE Corporation: https://linecorp.com/ja/csr/newslist/ja/2020/260

Usage

The following is the faq-search help output.

usage: main.py [-h] [-v] [-n NUM] [--server] [query]

faq search system

positional arguments:
  query              Search FAQ

options:
  -h, --help         show this help message and exit
  -v, --version      show program's version number and exit
  -n NUM, --num NUM  number of search results
  --server           server mode

Quick Start

git clone https://github.com/moz-sec/faq-search.git && cd faq-search
pip install -r requirements.lock

python src/faq-search/main.py -h
python src/faq-search/main.py インフルエンザ

Ubuntu

When pip install is performed on ubuntu, I get error: externally-managed-environment. Therefore, create another Python environment with venv, and install libraries and execute programs in that environment.

sudo apt install python3-pip python3.12-venv -y
git clone https://github.com/moz-sec/faq-search.git && cd faq-search
python -m venv .venv
source .venv/bin/activate

pip install -r requirements.lock
python src/faq-search/main.py -h

deactivate

Docker

You can also create a container image from the GitHub Container Registry(ghcr.io) and run it. It is located in pkgs/container. It is designed to execute python programs, and only program arguments can be specified. By default, python src/faq-search/main.py --help is executed. The image is created in docker/Dockerfile. See the Dockerfile for details.

docker pull ghcr.io/moz-sec/faq-search:latest
docker run ghcr.io/moz-sec/faq-search:latest
docker run ghcr.io/moz-sec/faq-search:latest インフルエンザ

Error handling

In some environments, Segmentation fault: 11 may occur. It occurs during SentenceTransformer() processing, but the cause is unknown. If this error occurs, setting the environment variable OMP_NUM_THREADS=1 will solve the problem.

reference: huggingface/sentence-transformers#2332

export OMP_NUM_THREADS=1
python src/faq-search/main.py インフルエンザ

Maintainers

License

MIT

About

`faq-search` is FAQ search system.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •