File size: 1,254 Bytes
a5fb347
951a2cd
 
 
 
 
 
 
 
a5fb347
951a2cd
 
 
 
 
 
 
 
 
 
49b9613
951a2cd
a5fb347
49b9613
 
 
 
 
 
 
 
 
d0a504b
c1f1320
9d2fc83
 
d0a504b
 
 
c1f1320
7f4b8b7
 
d0a504b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

# from flask import Flask, request, render_template
# from predict import Predict

# app = Flask(__name__)

# @app.route('/')
# def home():
#     return render_template('index.html')

# @app.route('/predict', methods=['POST'])
# def predict():
#     feature_list = request.form.to_dict()
#     result = Predict().predict(feature_list['code'])
#     return render_template('index.html', prediction_text=result)

# if __name__ == "__main__":
#     app.run(debug=True, use_reloader=False, port='8080')

import streamlit as st
from streamlit_ace import st_ace
from predict import Predict

# st.title("jRefactoring")
# codeSnippet = st.text_input('Enter Java Code here')
# st.text("")

# if st.button('Check'):
#     if(codeSnippet!=""):
#         st.text("")
#         result = Predict().predict(codeSnippet)
#         st.write(result)

st.title("jRefactoring - Automatic Extract Method Refactoring Detection Using Deep Learning")
st.subheader("Enter Java Code")
codeSnippet = st_ace(language = 'java', auto_update = True)
if st.button('Check'):
    if(codeSnippet!=""):
        st.text("")
        result, t, l = Predict().predict(codeSnippet)
        st.write("Threshold - "+ str(t))
        st.write("Calculated Loss - "+ str(l))
        st.write(result)