Een vertaler gemaakt door Mensen die graag normaal nederlands maar ook straattaal willen spreken.
Met deze instructies kun je deze straattaal vertaler beginnen en gebruiken.
- Python3
- Docker
Get the code:
# Clone the repo
git clone https://github.com/PimLeerkes/Straattaal-vertaler.git
# change directory
cd Straattaal-vertaler
Set up virtual environment:
# Create virtual environment
python3 -m venv env
# Activate the environment
source env/bin/activate
# Install requirements
pip install -r requirements.txt
Build docker container:
docker build -t straatvertaler/web_app .
You can also get up and running without cloning this repository directly to your machine.
Create and add this to the Dockerfile
:
FROM python:3.9-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
&& rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/PimLeerkes/Straattaal-vertaler.git .
RUN pip3 install streamlit
EXPOSE 8080
HEALTHCHECK CMD curl --fail http://localhost:8080/_stcore/health
ENTRYPOINT ["streamlit", "run", "web_app.py", "--server.port=8080", "--server.address=0.0.0.0"]
After that build the container.
With python:
streamlit run app/web_app.py
With docker:
docker run --name straatvertaler -p 8080:8080 straatvertaler/web_app
You can add -d flag for background use
- Open up your webbrowser at
localhost:8080
. - Type what you want translated
- Copy the text you want to use
- Done!
If you want to use it for your server you can definitely do that. Here are some examples:
Dockerfile
:
# Set server port to 80 or 443
ENTRYPOINT ["streamlit", "run", "app/web_app.py", "--server.port=8080", "--server.address=0.0.0.0"]
.streamlit/config.tom
:
# Set server port to 80 or 443
[server]
port = 8080
Also, streamlit has a community cloud where you can host it here
Libraries: