'How to train AI to create familiar sounding, randomly generated names?

I am very new to python and I'd like to ask for an advice on how to, where to start, what to learn. I've got this fantasy name generator (joining randomly picked letters), which every now and then creates a name which is acceptable, what I'd like to do though is to train an AI to generate names which aren't lets say just consonants, ultimately being able to generate human, elvish, dwarfish etc names.

I'd appreciate any advice in this matter.

Edit:

My idea is: I get a string of letters, if they resemble a name, I approve it, if not - reject. It creates a dataset of True/False values, which can be used in machine learning, at least that's what I am hoping for, as I said, I am new to programming. Again, I don't mind learning, but where do I begin?



Solution 1:[1]

Single characters are not really a good fit for this, as there are combinatorial restrictions as to which letters can be combined to larger sequences. It is much easier to not have single letters, but instead move on to bi-grams, tri-grams, or syllables. It doesn't really matter what you choose, as long as they can combine freely.

You need to come up with an inventory of elements which comply with the rules of your language; you can collect those from text samples in the language you are aiming for.

In the simplest case, get a list of names like the ones you want to generate, and collect three-letter sequences from that, preferably with their frequency count. Or simply make some up: For example, if you have a language with a syllablic structure where you always have a consonant followed by a vowel, then by combining elements which are a consonant followed by a vowel you will always end up with valid names.

Then pick 2 to 5 (or however long you want your names to be) elements randomly from that inventory, perhaps guided by their frequency. You could also add in a filter to remove those with unsuitable letter combinations (at the element boundaries) afterwards. Or go through the element list and remove invalid ones (eg any ending in 'q' -- either drop them, or add a 'u' to them).

Depending on what inventory you're using, you can simulate different languages/cultures for your names, as languages differ in their phonological structures.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Oliver Mason