![]() |
![]() |
![]() |
인공지능이 생각하고 있는 단어를 인간이 맞추는 프로그램입니다. 정답 단어를 추측하면, 추측한 단어가 정답 단어와 얼마나 유사한지 점수로 알려주게 됩니다. 오늘은 인공지능이 어떤 단어를 생각하고 있을까요? You Quiz? 아니 You Choo?
- FastText 모델을 로드하여 오늘의 단어를 선택합니다.
- 사용자는 아무 단어나 입력하며 계산된 유사도를 보고 추측한다.
- 포기하기를 입력하면 그 즉시 답을 알 수 있다.
- 정답은 명사와 동사, 부사 만을 포함합니다.
- 유사도는 FastText로 Pre-trained된 모델을 사용합니다.
- 유사도는 단어의 철자가 비슷한 것이 아닌 의미에 대한 유사도입니다.
예를 들어 나는 00에 간다. 00 안에 들어가는 단어는 수도없이 많습니다.
![]() |
![]() |
![]() |
pip install schedule fasttext scikit-learn wordcloud matplotlib flask redis
- FastText에 들어가서 한국어 모델을 다운로드 하셔서 bin 파일을 프로젝트 폴더에 넣어주시면 됩니다.
- 사용을 못한다면 sentences.json에서 굉장히 많은 문장을 추가한 다음 train/train.py를 실행시켜 단어를 추출하면 됩니다.
redis-server
- flask 서버 실행하기 전에 Redis 서버를 실행해줘야 합니다. (랭킹 DB 업로드)
python project/app.py
![]() |
![]() |
![]() |
- 오늘의 워드 클라우드
- 단어 유사도 계산
- 유사도 랭킹 테이블
- 사용자 랭킹 DB
- 게임은 하루에 한 번씩
- 오전 12시 초기화
- 사용자들의 첫 단어 -> 두 번째 단어 빈도 수 통계 -> 워드클라우드로 나타내기
- 웹사이트로 아이디어 발전
- 도전 횟수 업데이트 기능
- 유사도 점수 랭킹 저장
- 전체 사용자 랭킹 db 개발
- 사용자 랭킹 시스템 top5 -> n번째만에 맞추셨습니다. 랭킹은 n위입니다.
- 1초에 한 번씩 워드클라우드 업데이트
- 워드클라우드 오전 12시 되면 초기화
- 영어 입력 alert to gameinfo()
- t-SNE 사용-> 유사도를 더 시각적으로 확인
- 힌트 기능:
Follow these steps to enable automatic build & deploy from GitHub Actions.
-
Required repository secrets (Settings → Secrets → Actions):
GITHUB_TOKEN— provided by GitHub automatically (used by Actions).DEPLOY_HOST— remote server IP or hostname.DEPLOY_USER— SSH user on the remote host (e.g.,ubuntu).DEPLOY_SSH_KEY— private SSH key (PEM) forDEPLOY_USER(add as secret, do NOT add passphrase).- (optional)
REMOTE_COMPOSE_PATH— path todocker-compose.ymlon the remote host (e.g./home/ubuntu/youchoo/docker-compose.yml). - (optional)
MODEL_URL— public or signed URL where the FastText.binis stored (S3, object storage). If set, the container entrypoint will download the model at startup.
-
How it works:
- Push to
main/mastertriggers.github/workflows/ci.yml.
- Push to
- Action builds the Docker image from
project/Dockerfileand pushes to GitHub Container Registryghcr.io/<owner>/youchoo. - If
DEPLOY_*secrets are set, the workflow SSHes to yourDEPLOY_HOSTand pulls the new image. IfREMOTE_COMPOSE_PATHexists on the host the workflow will rundocker-compose pullanddocker-compose up -d; otherwise it will run the container withdocker run -d. If you setMODEL_URLas a repo secret, the deploy step will pass it to the remote process (asMODEL_URL) so the container entrypoint can download the large FastText.binat startup.
- Quick local steps to finalize:
- Make the deploy helper executable locally:
chmod +x ./scripts/deploy.sh
- Add the required GitHub secrets in repository settings.
- Push changes; the GH Actions workflow will run and (if secrets present) deploy automatically.
- Make the deploy helper executable locally:
If you'd like, I can add a second workflow that only runs on release tags, or add Docker Hub support instead of GHCR.
- Build the image locally (from repo root):
docker build -t youchoo-local:latest -f project/Dockerfile project- Run locally (bind port 8000):
docker run --rm -p 8000:8000 youchoo-local:latest- Test the app at
http://localhost:8000.
- Create a dedicated deploy SSH key on your server and add the public key to
~/.ssh/authorized_keysforDEPLOY_USER. Store the private key as theDEPLOY_SSH_KEYrepository secret. - Prefer restricting the deploy key to a single user and directory; do not reuse your personal keys.
- For extra security, consider using GitHub Actions OIDC or a short-lived token instead of long-lived SSH keys.
If you want, I can add a separate release.yml that only builds images when you push a Git tag, or I can add DockerHub support instead of GHCR.
You can upload your FastText .bin model to S3 and create a short-lived presigned URL to use as MODEL_URL in GitHub secrets. Example helper script is included at scripts/upload_model_to_s3.py.
Prerequisites:
awscredentials configured locally (via~/.aws/credentialsor environment variablesAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY).boto3installed:pip install boto3.
Example usage:
python scripts/upload_model_to_s3.py --file project/model/cc.ko.300.bin --bucket my-bucket --key models/cc.ko.300.bin --expiry 3600This prints a presigned MODEL_URL. Copy that value and add it to GitHub repository secrets as MODEL_URL (set a short expiry for security).








