How to define the possible combinations of factorials if we take sentence with words?

321950sk

New member
Joined
Aug 19, 2018
Messages
1
[h=1]How to define the possible combinations of factorials if we take the words in a sentence with a position number as a factorial?[/h]
In NLP context, I am researching an efficient way to define positions of all combinations of words in a sentence.In math I thought similar permutation methos is called: factorial= n! .

Whereby N is the elements to choose from, k the elements which could be chosen (1-N), order is not important, repetition is not allowed.

Imagine a sentence with 2 words:

I want.Splitting this sentence results in 2 word, where the positions are I=1, want=2.
As the formula specifies, the result is 2!=2 combinations (2^1= 2). The positions of these combinations are then 1.2 , 2.1.
Now I want to make a function/formula which gives me all the combinations with their position number as a list for any length. Probably this is a known math function and already as a function in the Java space.
Is there anyone who can help me with finding the formula or the function in Java, NLP which I can use in this context?
 
How to define the possible combinations of factorials if we take the words in a sentence with a position number as a factorial?


In NLP context, I am researching an efficient way to define positions of all combinations of words in a sentence.In math I thought similar permutation methos is called: factorial= n! .

Whereby N is the elements to choose from, k the elements which could be chosen (1-N), order is not important, repetition is not allowed.

Imagine a sentence with 2 words:

I want.Splitting this sentence results in 2 word, where the positions are I=1, want=2.
As the formula specifies, the result is 2!=2 combinations (2^1= 2). The positions of these combinations are then 1.2 , 2.1.
Now I want to make a function/formula which gives me all the combinations with their position number as a list for any length. Probably this is a known math function and already as a function in the Java space.
Is there anyone who can help me with finding the formula or the function in Java, NLP which I can use in this context?

With no context, I'm not sure what you mean by NLP; there are several possibilities! It's a good idea to spell things out when you are introducing yourself.

As I understand it, you want not just a count of possible ways to do something, but an actual list of those ways. This wouldn't be a mathematical function or formula as I understand it, but an algorithm (or perhaps a text function in Java). Am I right?

Unfortunately, you are mixing together words that probably don't mean what you intend them to mean; "combination" and "permutation" have specific meanings that are not what you seem to have in mind. So we have to clarify. It's good that you gave an example, but I'm not sure I follow it fully. Your n! gives the number of permutations (arrangements of a set of items in different orders); 2! would be the number of ways to order two words, namely (I, want) and (want, I). But you say ordering is not important, which is characteristic of combinations. Then you used the word combinations for "1.2 and 2.1", which might mean the two permutations I just listed.

My first impression was that you are saying you are given the string "Iwant", and are identifying the positions in this string where each word starts, namely (1, 2) as an ordered pair. Or are you given a list of already parsed words, ("I", "want") and want to list ways to order them?

Perhaps you need to give a slightly bigger example, maybe with three words, and specify the input and output you expect. (If you are programming, you should be aware of how to specify a program's or function's requirements!)
 
Top