Image caption Shamima Begum has said she is willing to return to the UK and "rehabilitate"

The case of teenager Shamima Begum has sparked a debate about how to deal with people linked to Islamic State - and how, if at all, to reintegrate them back into British society.

When she was tracked down in a Syrian refugee camp, the 19-year-old was described as an "indoctrinated IS bride" by the journalist who found her.

And in an interview with the BBC, Ms Begum seemed aware of what might await her if she returned - "a deradicalisation course".

But what might that involve - and does it work?

What is deradicalisation?

Deradicalisation programmes began emerging in the early 2000s, according to the academic-led Centre for Research and Evidence on Security Threats.

What makes them different to other strategies is the aim to change a person's ideas and attitudes.

In the UK, the government runs Prevent - a system which aims to identify vulnerable people and intervene in their lives before they become terrorists. Last year, 7,318 people were referred to the programme.

Prevent has different strands. The Channel scheme is for individuals who cause such concern that they need concerted help to deradicalise.

Another part is the Desistance and Disengagement programme, aimed at rehabilitating people already convicted of terror offences or returning from conflict zones. Last June, the government announced it was planning to double investment in that strand.

The government says it aims to tackle a person's ideology, as well as the personal issues which can drive radicalisation - for example around self-esteem and identity.

It can include one-to-one mentoring, support to get a job or education and psychological help.

Dr Sarah Marsden, a lecturer in radicalisation at Lancaster University, said the type of mentoring offered depends on the individual.

Sessions can be weekly or monthly and can include trained specialists - such as youth workers or imams - who may start by building up trust, she said.

And the conversations depend on the person's original reasons for getting involved in violent extremism.

"In some cases there will be a mentor just working on social issues," she said. "In others they will be specifically talking about ideology - whether it's far-right or Islamist.

"These will be more focused on readings of texts or readings of ideological positions, and discussing them to introduce the individual to alternative ways of interpreting texts and help them to try and understand it's not the only version."

How does it work?

Dr Marsden, who has spent time with organisations that work with extremists, said there is not enough evidence to say which particular techniques work best.

But her research suggested one of the most useful methods was finding out why someone was drawn to violent extremism, and then "redirecting these motivations" to create a more positive future.

"Ultimately, change has to come from within," she said, "You have to be motivated to do that, otherwise it's just lip service.

"Motivation can come from the individual by what they have seen or experienced and they do not want to go through it again.

"Or they can be motivated because other people work with them to instil that motivation."

Image copyright Met Police Image caption Parsons Green bomber Ahmed Hassan had been enrolled in Prevent, but still went on to carry out his attack

Hanif Qadir, a former adviser to the government and who has worked with extremists in deradicalisation programmes, said Ms Begum was a "spot on candidate" for such a programme.

He himself was radicalised in 2002 and travelled to Afghanistan to join al-Qaeda, but quickly returned when he saw young children being recruited as suicide bombers.

He said Ms Begum's language in interviews - for example talking in the past tense about how she understood IS's ideology - was a "chink in her armour" which could be a starting point for discussions.

How can you tell if deradicalisation has worked?

Deradicalisation is not an exact science and mistakes can be made, for example with the 2017 Parsons Green bomber who had been enrolled in the Prevent programme.

It's a "really complex" task determining whether someone who claims they've changed their extremist views actually has, said Dr Marsden.

"How do you actually know that somebody isn't just saying that to make their lives a bit easier?"

But she said "people do change their minds" and criminal justice professionals "are very familiar with this" conundrum.

Judgements about the individual's credibility are made, as well as risk assessments by a range of professionals.

"If [the extremist] doesn't believe in the ideas any more, you can take it as a reduction of risk but it's not a guarantee. Equally, having very strong political opinions doesn't mean they will go out and commit a crime."

Nikita Malik, who heads up the Centre on Radicalisation and Terrorism at the Henry Jackson Society, has carried out research into women who have joined IS and then returned home with their children.

She said: "Unfortunately, even the deradicalisation programme we have for returnees - which is a Desistance and Disengagement programme - incentivises people in it to lie because the notes are shared with the judges who then determine how often they can see their child."

Hanif Qadir, who is CEO of the Active Change Foundation, recalls working with one young man who had been convicted of terror offences.

To test his progress, he asked the man to speak about his experiences to a crowd of other young people.

"When he started to open up [about his extremism] he got very, very emotional. A couple of young men approached him after the talk and said 'this is exactly what we're feeling.'

"He then mentioned them to me. That was a measure of success as he could have not told me about these guys."