There are some rules though!
For the words (generally verbs and their derivatives) like emmener, ennuyer, emmurer, and so many others, the "en/em" is pronounced /ɑ̃/ (as in "vent", "dans", etc) because this part is the prefixe en/em which generally signifies inside (enfermer), or a movement upwards/onwards (emmener).
Otherwise, the general rule when the letter e is placed in front of 2 consonnants is to pronounce it as /ɛ/ like in "gemme", "dilemme", "poubelle" or "escalier". It should also be the rule for "fennec" which I've mostly heard pronounced "fɛnɛk", but it is true that some people pronounce it "fənɛk", but I'm not sure if it's because it is originally a foreign word, because of a regional accent, or just because they are making a mistake!
Then we have of course exceptions.
All the adverbs formed from adjectives ending in -ent (fréquent -> fréquemment, apparent -> apparemment) will be pronounced /amɑ̃/ instead of /əmɑ̃/, and I have no idea why, but I would say it comes from a confusion with the similar adverbs formed from adjectives ending in -ant (courant -> couramment). Since the pronunciation of -ent and -ant is the same and in the paste few people knew how to write, I guess that people were confused and started to pronounce all the adverbs "amment" (warning, this is a personal theory based on 0 fact).
Then you have exceptions like "femme" and "solennel" where the weird pronunciation comes from the evolution of the pronunciation over the centuries: the letter e was first pronounced /e/, then /ɑ̃/, and finally /a/, but the spelling didn't follow these changes (more details here: https://dictionnaire.orthodidacte.com/article/prononciation-femme)
I'm sure we can find other exceptions, and each time you will need to study the etymology and the evolution of the pronunciation of the word to understand why it's pronounced like that.
Last and not least, you have regional accents which come put a cherry on the top of this complex question!
So to answer your question, yes it is possible to know how to pronounce a word with "emme"/"enne" by just looking at it if you have basic notions of French grammar (recognize an adverb or the prefix), but you might still be wrong if the word happens to be an exception!
So for your project you can for example enter the default value of "emme" pronounced as /ɛm/ but it won't be very relevant, so to be really efficient you will need to teach your computer some basis about prefixes and averbs at least...