Hub
Pricing About
WorkflowWorkflow

justknimeit-34 - Word Scramble

Justknimeit-34RandomRandomisationRandomizationJustknimeit
+2
ndwulst profile image
Draft Latest edits on 
Sep 15, 2022 11:30 PM
Drag & drop
Like
Download workflow
Workflow preview
Challenge 34 - Word Scramble Level - Medium Description - One of your tasks at work is to train a model using sentences with the correct word context (i.e., words in a sentence following a meaningful and correct order). However, to train such model, you also need to create a dataset of words used in an incorrect context. You can think of this task as a version of Negative Sampling - a neat technique for training the famous Word2Vec model. Concretely, in this challenge you will create a workflow that takes a sentence and scrambles the order of its words. You can create a small sample of sentences to test your work with the Table Creator node. Input I like cats. Output cats. like I Hint - Our simple solution only uses 5 nodes, but the permutations are not exactly random. Conversely, our more complex solution uses more than 15 nodes and 2 loops, as well as the Random Numbers Generator node, to create truly scrambled sentences. Bonus - Create a solution with true randomization without using any loops. ------------------------------------------------------------------------------------------------------------- 4 workflows have been designed to solve this problem - 1) The simplest solution requires 5 nodes. However, this method has a small limitation in which all rows are shuffled at the same time i.e. each column has its row reordered in a similar manner, hence, it does not cover all permutations. 2) A loop-based solution, whereby each sentence (represented by an individual column) is scrambled in its own manner 3) Another loop-based solution, similar to 2 but using a Random Numbers Generator node to assign a random number to generate the scrambled word order for each sentence. 4) Another solution involves a loop-free workflow to create true randomization of each sentence. In this workflow, all the words in all the sentences are collected in a single column. Then the rows are shuffled, creating a column of words in a random order. Then using a groupby node, the words are grouped based on the original sentence they came from. The groupby output is a list of scrambled words in the appropriate sentence. Further manipulation gives the fully scrambled sentence.
Loading deploymentsLoading ad hoc jobs

Used extensions & nodes

Created with KNIME Analytics Platform version 4.6.1
  • Go to item
    KNIME Base nodesTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 4.6.1

    knime
  • Go to item
    KNIME Data GenerationTrusted extension

    KNIME AG, Zurich, Switzerland

    Version 4.6.0

    knime
  • Go to item
    Vernalis KNIME NodesTrusted extension

    Vernalis Research Ltd, Cambridge, UK

    Version 1.36.0

    vernalis

Legal

By using or downloading the workflow, you agree to our terms and conditions.

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits