<jupyter_start><jupyter_text>Install and Config LingX<jupyter_code>!git clone https://github.com/ContentSide/lingx.git
%cd lingx
!pip install -e .<jupyter_output><empty_output><jupyter_text>Import Libraries<jupyter_code>import lingx.utils.download_lang_models
from lingx.core.lang_model import get_nlp_object

nlp_en = get_nlp_object("en", use_critt_tokenization = False, package="partut")
nlp_zh = get_nlp_object("zh", use_critt_tokenization = False)
from lingx.core.lang_model import get_nlp_object
from lingx.utils.lx import get_sentence_lx

nlp_en = get_nlp_object("en", use_critt_tokenization = False, package="partut")

input = "The reporter who the senator attacked disliked the editor."

tokens_scores_list_idt , _ = get_sentence_lx(
                                            input,
                                            nlp_en,
                                            result_format="segment",
                                            complexity_type="idt", 
                                            aggregation_type="sum")


tokens_scores_list_dlt , _ = get_sentence_lx(
                                            input,
                                            nlp_en,
                                            result_format="segment",
                                            complexity_type="dlt", 
                                            aggregation_type="sum")


tokens_scores_list_idt_dlt , _ = get_sentence_lx(
                                            input,
                                            nlp_en,
                                            result_format="segment",
                                            complexity_type="idt_dlt", 
                                            aggregation_type="sum")

from lingx.utils.plot import plot_complexity_profiling

plot_complexity_profiling(input, tokens_scores_list_idt, type_x="IDT")
from lingx.utils.plot import plot_complexity_profiling

plot_complexity_profiling(input, tokens_scores_list_dlt, type_x="DLT")
from lingx.utils.plot import plot_complexity_profiling

plot_complexity_profiling(input, tokens_scores_list_idt_dlt, type_x="Combined IDT+DLT")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup