Bareun Docker installation in 10 minutes
Bareun (bareun) is distributed as a Docker image, so a few commands are enough to start a Korean
morphological analysis server. This quick guide takes you from docker pull through API key registration to your first analysis request in about 10 minutes.
For more detailed options and settings, see Docker installation; if this is your first time,
also see the Quick start.
What to prepare first
Sign up at bareun.ai and get an API key.
An API key looks like koba-ABCDEFG-1234567-LMNOPQR-7654321.
Docker must be installed.
1. Pull the image (about 2 minutes)
docker pull bareunai/bareun:latest
2. Run the server (about 1 minute)
Create a directory to store data and logs, and start the container. The Docker distribution serves on port 5656.
mkdir -p ~/bareun/var
docker run -d -p 5656:5656 -v ~/bareun/var:/bareun/var bareunai/bareun:latest
-d: run in the background-p 5656:5656: map host port 5656 to the container-v ~/bareun/var:/bareun/var: keep the Bareun registration result or license, custom dictionary, logs, and the models downloaded on first startup on the host (without this mount, hundreds of MB of models are downloaded again every time the container is recreated)
3. Register the API key (about 1 minute)
Run the -reg option with your own API key.
docker exec bareun /bareun/bin/bareun -reg koba-ABCDEFG-1234567-LMNOPQR-7654321
Do not use the example key as is
koba-ABCDEFG-1234567-LMNOPQR-7654321 is only an example.
Replace it with your own key issued at bareun.ai.
4. Make your first analysis request (about 3 minutes)
Check it right away with the Python client.
from bareunpy import Tagger
API_KEY = "koba-ABCDEFG-1234567-LMNOPQR-7654321" # replace with your own key
tagger = Tagger(API_KEY, 'localhost', 5656)
res = tagger.tags(["안녕하세요.", "바른을 도커로 설치했습니다."])
print(res.pos())
[('안녕하', 'VA'), ('시', 'EP'), ('어요', 'EF'), ('.', 'SF'),
('바른', 'NNP'), ('을', 'JKO'), ('도커', 'NNG'), ('로', 'JKB'),
('설치하', 'VV'), ('았', 'EP'), ('습니다', 'EF'), ('.', 'SF')]
Install the library with pip install bareunpy. Besides Python, Java, JavaScript, and R clients and an
Elasticsearch plugin are available, so the same server can be used from several languages.
How to call the analysis API is covered in detail in Morphological analysis with the API.
Frequently asked questions
Q. Can I also use the spell checker when I install with Docker?
The free installable version of Bareun provides the morphological analyzer only. The Korean spell checker is offered in the cloud
(api.bareun.ai), and installation in a closed network requires a separate paid contract.
Q. Can I open the API key registration screen on the web?
Yes. You can also register by accessing the API key registration web page on the installed system.
The result is the same as the command-line method (-reg).
Q. Is the key kept when I restart the container?
Yes. If you mounted -v ~/bareun/var:/bareun/var, the Bareun registration result, license,
custom dictionary, and logs are kept on the host and persist after a restart.
Q. Which language clients can call the Docker distribution?
Python (pip install bareunpy), Java, JavaScript, and R clients and an Elasticsearch plugin are
provided. Bareun runs as a server, so one installation can be used
by many users and in many languages at the same time. REST API and gRPC are also supported.