Rep. Anthony Weiner says he’s taking a leave of absence from Congress to seek treatment for sending racy Twitter messages and semi-clothed photos of himself to women he apparently never met.

Which raises a question: There’s a treatment (or perhaps tweet-ment) for a problem like this?

Answer: Yes, but. . . . Well, it gets complicated.

The Democratic congressman from New York hasn’t said where he’s going for treatment, what he’s hoping to treat or how long he intends to stick with it. His spokeswoman, Risa Heller, said in a statement over the weekend that Weiner wants “to focus on becoming a better husband and healthier person.” He needs an unspecified leave so that “he can get evaluated and map out a course of treatment to make himself well,” she said.

Cynics (and we know who we are) would suggest that by “pathologizing” his dubious behavior, Weiner is merely stalling for time and perhaps making a bid for public sympathy. The I’m-going-to-rehab line is de rigueur for celebrities and others who have hit a very public pothole. In Weiner’s case, his therapy announcement comes as calls for his resignation have grown to a roar, including among his party’s leaders. Weiner has said he won’t quit.

Therapists, however, aren’t quite as cynical about Weiner. In their professional judgment, his issues look very real, and very familiar. Based on media accounts alone — no one interviewed for this article has ever treated or met Weiner — they say his actions suggest sexual compulsivity, a condition that can take many forms, from exhibitionism to porn “addiction” to, yes, sending sexually suggestive tweets and towel-draped photos.

Sexual compulsivity doesn’t require compulsive sex or even physical contact with another person. It entails repetitive, sexually oriented behavior involving risk, whether to one’s career, marriage and relationships or reputation, says Kenneth Paul Rosenberg, an addiction psychiatrist at Weill Cornell Medical College in New York.

“From everything I’ve read and heard” about Weiner, he says, “all of his behaviors sound like a pretty garden-variety case.”

What startles so many people is how much Weiner risked in his online dalliances with at least six women: his congressional seat, a year-old marriage to a longtime adviser to Hillary Clinton, a potential shot at becoming mayor of his home town, New York.

But that’s typical, therapists say.

To the sexually compulsive, it feels good getting away with something transgressive and self-focused. “It’s like sky diving,” says Marion Solomon, a marital therapist in Los Angeles. “It’s the risk. It’s a risk that gives pleasure. It’s dangerous, but he was narcissistic enough to believe that he could get away with it. He concluded, ‘I’ve covered myself. No one will find out.’ ”

Sexual compulsives know they’re out on a limb but often can’t stop, just as substance abusers and compulsive eaters, gamblers and shoppers can’t turn off their obsessions, says Helen Friedman, a St. Louis clinical psychologist who specializes in sexual compulsivity and sexual issues.

The difference, she says, is that sexual transgressions are still the most shameful and furtive in our culture. Which means sexual compulsives tend to carry on until they reach some crisis point — a failed marriage, a lost job or, in Weiner’s case, a public outing.

Social media tools like Twitter and Facebook just make it easier to be compulsive. Friedman calls the Internet “the crack cocaine” of sexual compulsivity because it’s affordable, accessible and seemingly anonymous. No one needs to leave home (or, in Weiner’s case, the office or House gym) to carry on with strangers or feed a porn habit.

She doesn’t see much difference between Weiner and Tiger Woods, whose serial infidelity cracked up his marriage and impaired his brilliant golf career.

“The drugs of choice are not as important as understanding the behavior” that underlies it, she says. “It’s like alcoholism. We’re not really concerned if they’re drinking Jack Daniel’s or if they’re drinking Budweiser. We’re concerned that they’re abusing alcohol.”

Treatment can take a number of forms: individual counseling, group therapy, 12-step programs, even drugs, or a combination of all. Family members are often involved. The basic approach, says Solomon, is to help an individual become more “emotionally aware” by understanding where such impulses might have started, which usually means in childhood, and what they’re compensating for.

The good news for someone like Weiner is that the stakes are so high, Rosenberg says. “He’s incentivized to do well,” the psychiatrist says.

The bad news: “The biggest hurdle is the [marital] relationship. It’s very hard for the spouse to forgive or forget. Many times, [the spouse] isn’t shocked by the behavior, but they are traumatized by it,” Rosenberg says.

What’s more, a person needs to stick with therapy for months, if not years, to learn to control compulsive behavior. If they’re done in a week, it’s a pretty good indicator they’re not serious about it

Friedman was struck by something Weiner said at the news press conference where he finally admitted he’d lied about his behavior. “If you’re looking for some kind of deep explanation for this,” he said, “I don’t have one except to say I’m sorry.”

Yes, exactly, she thought. Shame. Regret. And a profound lack of self-awareness. She’s seen it all before.

“People don’t know why they do it,” she says. “That’s part of what therapy is for. To help them understand themselves.”