Tree() argument 2 should be a list, not a string

val = st.text_input("Enter a sentence/paragraph")
    grammar = """NP: {<DT>?<JJ>*<NN>}
VBD: {<VBD>}
IN: {<IN>}"""
    cp = nltk.RegexpParser(grammar)

    result = cp.parse(val)
    out = Tree.fromstring(str(result))
    
    if st.button("Chunking"):
        st.success(out)

It is giving this erroe even when the sentence input is in format
[("the", "DT"), ("little", "JJ"), ("yellow", "JJ"), [![[1]("dog", "NN"), ("barked", "VBD"), ("at", "IN"), ("the", "DT"), ("cat", "NN")]