Some basic training in how to seize and or jam the weapon would be practical. You would have to be face to face with the armed individual, which I don't recommend you do, but if you have no other choice you could grab the weapon and jam it by playing with the action. If you're knowledgeable with how a semiautomatic works and have some good luck in jamming the gun you should, if the gun is still in his hands try to wrestle it away and or engage in a fisticuff.
Another thing, which Hollywood movies shows, are two guys wrestling with the firearm and trying to get it to point at your opponent. In reality, if it's a rifle and you can get it within a foot of his head it does not need to go much further because pulling the trigger may knock him out or disorient him with the shock of the muzzle blast. The bullet itself doesn't have to hit him at all to give him a concussion.
Yes I know this all sounds crazy and desperate, with as much danger to yourself as to the shooter, but it's better than nothing.