Giter Club home page Giter Club logo

ttum's Introduction

Text-to-UML: TTUM

ttum_logo

What It Does

ttum_logo_sketch

TTUM is a program that converts sentences in natural language into a UML diagram image, using deep learning.

Installation

  • Run:
$ python -m venv .venv                  # Create virtual environment
$ .venv/bin/activate                    # or '.venv\Scripts\activate' on Windows
$ pip install --upgrade pip             # or 'python -m pip install --upgrade pip' on Windows to update pip
$ pip install -r requirements.txt       # Get packages using requirements.txt

Frontend (Run on frontend/)

  • Install npm.

  • Run this to install react-scripts and axios.

$ cd frontend
$ npm install --save react-scripts # Install react-scripts
$ npm install --save axios # Install axios

Backend (Run on backend/)

  • Remove files other than __init__.py from ttum/backend/api/migrations/.
  • Set up database
$ cd backend
$ py manage.py makemigrations
$ py manage.py migrate
$ py manage.py createsuperuser # Create superuser for the server
  • Create and save any value to title, image_name, _type to a row in Task table in the SQLite database on localhost:8020/admin.

Download NLTK Data

You need to download NLTK data to use the nlp module.

  1. You need to uncomment nltk.download('all') in NLPHandler.__init__ in nlp.py when you run for the first time.
  2. When you run the program with the uncommented line, the program will download NLTK data from the NLTK server.
  3. Then, you can comment the line again.

Create Training Checkpoints

  • In order to use the model to translate natural language to PlantUML text, you need to train the model with the train.csv.
  • Give epoch parameter of UMLHandler an integer more than 0 at least once, to train the model and create checkpoints in training_checkpoints/.
    • We recommend assigning a number bigger than 300 to the epoch.
  • Then, you can set epoch=0 again, so that the program can just restore the checkpoints to translate next time you run it.
  • If there is any change in train.csv, you need to train the model again.

Running the Server

You need to run both the backend and frontend servers, if you wish to run TTUM on web.

Backend

$ cd backend
$ py manage.py runserver 127.0.0.1:8020

Frontend

$ cd frontend
$ npm run start

Running Only the Deep Learning Model

If you wish to run without the server, just run main.py in the backend/nlp/, which is a short demo of the image creating process.

Files and Folders

uml_model and usecase_model.py

  • A tensorflow model utilizing seq2seq
  • Receives train.csv as input and trains the model.

Training Data File (.csv)

train.csv

  • A data file that contains the training data for the model
  • This is a file where English-to-PlantUML data should be added.
  • Please add more quality data!

Coding Style

Please follow PEP 8 for Python codes. (4 spaces for indentation!)

Note

  • This project works by connecting to the PlantUML server.

  • We used SamuelMarks/python-plantuml, which is forked from dougn/python-plantuml to get access to the PlantUML server using Python!

  • These are all open source projects on GitHub, so check them out!

  • Currently TTUM only works for creating usecase diagrams, so please participate in the project.

ttum's People

Contributors

litsynp avatar hyunsooklm avatar jinsungmin avatar cauminam avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.