🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to Segment Text Effectively Using TextTiling with Python 3.x

User: "koushikdeb2009"
New Altair Community Member
Updated by Jocelyn

I have written these line of codes

 

f = open("1.ref","r")
alice=f.read()
tt = nltk.tokenize.TextTilingTokenizer()
tiles = tt.tokenize(alice[0:2000])
print(tiles) #Total text in a single valued list

I need to consider full text.If I omit [0:2000] ,then getting an error

TypeError: slice indices must be integers or None or have an index method

Spoiler
 

While printing tiles ,I am getting full text.I need to show segmented text.

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "Thomas_Ott"
    New Altair Community Member

    @koushikdeb2009 can you post the XML process using the </> button? It will be helpful to see how you formed the python script in Execute Python operator. 

    User: "koushikdeb2009"
    New Altair Community Member
    OP

    There is no XML process.Its program to implement Text Tile process.If there is any code sample to implement texttiling properly with python 3.x ,then please send the link.It will be great help to my project.

    User: "Thomas_Ott"
    New Altair Community Member

    @koushikdeb2009 we usually see python executed in RapidMiner via the Execute Python operator, hence me asking if you can post your XML process. If you're strictly working in python, then I'd suggest visiting a forum related to Text Tiling. 

While printing tiles ,I am getting full text.I need to show segmented text.

Find more posts tagged with

  • AI Studio
  • Python
  • Text Mining + NLP
  • Accepted answers

    All comments

    Photo of Thomas_Ott Thomas_Ott

    @koushikdeb2009 can you post the XML process using the </> button? It will be helpful to see how you formed the python script in Execute Python operator. 

    Photo of koushikdeb2009 koushikdeb2009

    There is no XML process.Its program to implement Text Tile process.If there is any code sample to implement texttiling properly with python 3.x ,then please send the link.It will be great help to my project.

    Photo of Thomas_Ott Thomas_Ott

    @koushikdeb2009 we usually see python executed in RapidMiner via the Execute Python operator, hence me asking if you can post your XML process. If you're strictly working in python, then I'd suggest visiting a forum related to Text Tiling.