Update pages/Workflow & Model Overview.py
Browse files
pages/Workflow & Model Overview.py
CHANGED
|
@@ -63,10 +63,10 @@ st.markdown("""
|
|
| 63 |
</div>
|
| 64 |
""", unsafe_allow_html=True)
|
| 65 |
|
| 66 |
-
st.markdown('<div class="sub-title">Installation</div>')
|
| 67 |
st.code('!pip install spark-nlp', language='python')
|
| 68 |
|
| 69 |
-
st.markdown('<div class="sub-title">Import Libraries and Start Spark Session</div>')
|
| 70 |
st.code("""
|
| 71 |
import sparknlp
|
| 72 |
from sparknlp.base import DocumentAssembler, PipelineModel
|
|
@@ -82,7 +82,7 @@ st.markdown("""
|
|
| 82 |
</div>
|
| 83 |
""", unsafe_allow_html=True)
|
| 84 |
|
| 85 |
-
st.markdown('<div class="sub-title">Define the Pipeline</div>')
|
| 86 |
st.code("""
|
| 87 |
# Transforms raw texts into `document` annotation
|
| 88 |
document_assembler = (
|
|
@@ -106,7 +106,7 @@ st.markdown("""
|
|
| 106 |
</div>
|
| 107 |
""", unsafe_allow_html=True)
|
| 108 |
|
| 109 |
-
st.markdown('<div class="sub-title">Create Example DataFrame</div>')
|
| 110 |
st.code("""
|
| 111 |
example = \"""
|
| 112 |
Transfer learning, where a model is first pre-trained on a data-rich task
|
|
@@ -129,7 +129,7 @@ models, and code.
|
|
| 129 |
spark_df = spark.createDataFrame([[example]])
|
| 130 |
""", language='python')
|
| 131 |
|
| 132 |
-
st.markdown('<div class="sub-title">Apply the Pipeline</div>')
|
| 133 |
st.code("""
|
| 134 |
result = pipeline.transform(spark_df)
|
| 135 |
result.select("t5.result").show(truncate=False)
|
|
|
|
| 63 |
</div>
|
| 64 |
""", unsafe_allow_html=True)
|
| 65 |
|
| 66 |
+
st.markdown('<div class="sub-title">Installation</div>', unsafe_allow_html=True)
|
| 67 |
st.code('!pip install spark-nlp', language='python')
|
| 68 |
|
| 69 |
+
st.markdown('<div class="sub-title">Import Libraries and Start Spark Session</div>', unsafe_allow_html=True)
|
| 70 |
st.code("""
|
| 71 |
import sparknlp
|
| 72 |
from sparknlp.base import DocumentAssembler, PipelineModel
|
|
|
|
| 82 |
</div>
|
| 83 |
""", unsafe_allow_html=True)
|
| 84 |
|
| 85 |
+
st.markdown('<div class="sub-title">Define the Pipeline</div>', unsafe_allow_html=True)
|
| 86 |
st.code("""
|
| 87 |
# Transforms raw texts into `document` annotation
|
| 88 |
document_assembler = (
|
|
|
|
| 106 |
</div>
|
| 107 |
""", unsafe_allow_html=True)
|
| 108 |
|
| 109 |
+
st.markdown('<div class="sub-title">Create Example DataFrame</div>', unsafe_allow_html=True)
|
| 110 |
st.code("""
|
| 111 |
example = \"""
|
| 112 |
Transfer learning, where a model is first pre-trained on a data-rich task
|
|
|
|
| 129 |
spark_df = spark.createDataFrame([[example]])
|
| 130 |
""", language='python')
|
| 131 |
|
| 132 |
+
st.markdown('<div class="sub-title">Apply the Pipeline</div>', unsafe_allow_html=True)
|
| 133 |
st.code("""
|
| 134 |
result = pipeline.transform(spark_df)
|
| 135 |
result.select("t5.result").show(truncate=False)
|