-
Notifications
You must be signed in to change notification settings - Fork 0
/
streamlit_app.py
37 lines (29 loc) · 1.13 KB
/
streamlit_app.py
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
import streamlit as st
import os
import re
import json
import torch
import helper
import numpy as np
from torch import nn
from torch.nn import functional as F
import pickle
import model
net = model.net
vocab = model.vocab
premise = "Saya lapar sekali."
hypothesis = "Saya tidak tidur."
st.set_page_config(layout="wide")
st.title('Natural Language Inference for Bahasa Indonesia')
st.text('Analyzing the logical relationship between premise and hypothesis.')
premise = st.text_input('Premise (end sentence with .)')
hypothesis = st.text_input('Hypothesis (end sentence with .)')
if st.button('Predict'):
if(premise != "" and hypothesis != ""):
st.subheader('Output')
result = model.predict_inli(net, vocab, premise.split(), hypothesis.split())
st.write(result)
st.sidebar.header('About')
st.sidebar.write('Project on NLP task known as Natural Language Inference (NLI). NLI involves determining the relationship between pairs of sentences, typically categorized as entailment, contradiction, or neutral.')
st.sidebar.header('Source')
st.sidebar.markdown("+ [Github](https://github.com/chukbert/naturalLanguageInference)")