File size: 1,231 Bytes
46cacbc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# import
import streamlit as st
from parstdex import Parstdex

# set config
st.set_page_config(layout="wide", page_title="Parstdex")

model = Parstdex()
model.extract_span("تست: ساعت ۸ صبح")



# APP
# set title and subtitle
st.title("Parstdex")
st.markdown("Paste any persian (farsi) text you want to extract its time and date 🖖.")
# create the input text box and setting panel
text = st.text_area('Paste your text here...', "ساعت ۸ صبح من و علی قرار گذاشتیم که شانزده بهمن ۱۳۷۵ هم دیگر را در دوشنبه بازار ببینیم.", height=50)
button = st.button("Extract")

# if button is clicked
with st.spinner("Processing Text  and Extracting..."):
    if button and text:
        # extract markers from the text
        spans = model.extract_span(sentence)
        markers = model.extract_marker(sentence)
        values = model.extract_value(sentence)
        ners = model.extract_ner(sentence)

        # display the result
        st.markdown("**Spans:**")
        st.write(spans)
        st.markdown("**Markers:**")
        st.write(markers)
        st.markdown("**Values:**")
        st.write(values)
        st.markdown("**NER:**")
        st.write(ners)