When a dog comes running to me, I wonder how I can assess whether they want to attack or greet me.
Most dogs don't attack.
If they are growing / snarling and showing teeth that is not a good sign.
If they are playful with tail wagging that is a good sign. Even if they want to play they don't typically run straight at a stranger. Typically they will check you out from a distance first. Even dogs going to a park will typically check other dogs out first.
You can come across a danger dog that just plain means business and is not even snarling. If you are on strange land they could just be defending territory.
And breed matters. Two Golden Retrievers charging me and I am not much worried. Two Pit Bulls charge and I am pulling my knife ready to defend. A Dachshund can also be aggressive and bite but they cannot do much damage.
My dogs that would not bite anyone will run at a stranger and bark in my yard but they stop like 5' short.
Even if you are afraid running is probably not the best action. A dog that just wants to challenge you will sense fear and may decide to attack.
If you do ML and NLP I think you could go to a few dog parks and just pick it up. Dog protocol is way easier than NLP.
if the dog is friendly, his tail will be wagging side to side, he may bark in greeting, a fearful dog will have a still tail, he maybe barking, he will probably run toward you then possibly run away, an aggressive dog will have a sticking up still tail, he will be forward, and growling & maybe barking, he maybe showing his teeth, also watch their ears, dogs first smell, hear then see, so watch their ears, tail, be observant.