This phenomenon is called bitter taste syndrome and often occurs after certain eating foods or after brushing the teeth. The altered taste lasts anywhere from a few hours to a few weeks.
Common food culprits include toothpaste, pine nuts, tomatoes, artichoke, pineapples, and certain medications.
Not everybody experiences this problem which is felt to be due to misfiring of the sweet taste receptor in the mouth.
If per chance you are suffering from this, not to worry... it will resolve with time. However, a little sugar or artificial sweetener in food (or on the tongue) can help as well as rinsing the mouth with watered-down milk-of-magnesia or chewing (non-mint-flavored) gum.