how to tokenize documents?
I'm wondering if it's feasible to tokenize documents, as the tokenize operator itself only offers the option to tokenize on expressions and the likes.
As an example consider the following scenario : a collection of similar documents in a folder is loaded and combined in a single document using the combine document operator. Using the extract token number operator shows there are indeed n tokens in the document (where each token represents a loaded document) but there seems to be no option to loop through these tokens afterwards, or option to split again by token later in the process.
Is this indeed not possible or is there some cool but not so very visible option available that would allow me to tokenize on combined documents?
As an example consider the following scenario : a collection of similar documents in a folder is loaded and combined in a single document using the combine document operator. Using the extract token number operator shows there are indeed n tokens in the document (where each token represents a loaded document) but there seems to be no option to loop through these tokens afterwards, or option to split again by token later in the process.
Is this indeed not possible or is there some cool but not so very visible option available that would allow me to tokenize on combined documents?
Tagged:
1
Best Answer
-
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data ScientistHi@kayman,now i understand. There is nothing to split on, but you want to export the tokens itself. Something like this groovy script i guess?
< ?xml version = " 1.0 " encoding = " utf - 8 " ?> <过程版本sion="9.3.001">
- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany6
Answers
@mschmitzis there another solution here?
Lindon Ventures
Data Science Consulting from Certified RapidMiner Experts
if i understand this correctly, you may have something like
and you want to break this up into separate documents, splitted on ;?
If yes, an easy way to do this would be the Split into Collection operator in Operator Toolbox.@tftemme's original use case was JSON parsing, so you get each item of an array as a document.
I think there are some ways of doing this with reguar regions in Cut Document as well.
Best,
Martin
Dortmund, Germany
When looking at the document result rapidminer shows the distinction between the documents (as the color is different from doc 2 doc) but there is no real way to get the actual tokens / separate docs. Unless there is this super secret special symbol used by rapidminer to distinguish where one doc (token) ends and another one starts.
Dortmund, Germany
Find attached simplified example :
Just 2 no-sense documents stitched together for the exercise, but I want to split them again as document. The document outcome shows the two documents as separate tokens, but splitting them into actual docs isn't that straightforward it seems. I've tried a variety of regex expressions but they always provide me either single sentences, or nothing, but not the total document.
Dortmund, Germany
If so, I believe Loop Files actually inserts a space between docs (don't ask me why!) so you can just do this:
The folder I used for this is attached below so you can match my process. You'll have to change the path of Loop Files of course.
Scott
Dortmund, Germany