In 2014, Cheryl returned as a judge on the UK version of The X Factor for its eleventh series, signing a PS1.5 million contract. She was joined by Simon Cowell, Louis Walsh and Mel B on the judging panel. She was again selected to mentor the girls category, and she chose Chloe Jasmine, Stephanie Nala, Lauren Platt and Lola Saunders for the live shows. Nala and Jasmine were eliminated in week 2 and Saunders in week 4, while Platt finished fourth. In 2015, Cheryl returned to The X Factor for its twelfth series; she was joined by Cowell and new judges Rita Ora and Nick Grimshaw. She was selected to mentor the groups category for the first time and chose 4th Impact, Alien Uncovered and Reggie 'n' Bollie for the live shows. Alien Uncovered were eliminated in week 1, while 4th Impact and Reggie 'n' Bollie finished in fifth and second place, respectively. Cheryl confirmed her departure from The X Factor in April 2016, choosing to focus on her music career.  On 2 June 2014, she debuted the first single from her fourth studio album Only Human, "Crazy Stupid Love", which features Tinie Tempah. Later in the month, she performed at Capital FM's Summertime Ball at Wembley Stadium. On 27 July, "Crazy Stupid Love" entered the UK Singles Chart at number one, selling 118,000 copies. It became her fourth number one single on the chart, making her the third British female artist to achieve four numbers ones as a solo artist, after Geri Halliwell and Rita Ora. The song also peaked at number one in Ireland. The second single from Only Human, "I Don't Care", was released on 2 November and similarly to its predecessor debuted at number one in the UK, becoming her fifth number one in the country. This made her the first British female to have five solo number one singles in the UK. Only Human was released on 10 November and became her fourth solo album to debut within the top 10 in the United Kingdom and Ireland. It was later certified silver in the UK. The album's title track was chosen as its third single. The song, which originally peaked at number 70 as an album cut in October 2014, failed to reach the top 100 on the UK Singles Chart upon the single's release, therefore becoming her lowest-charting single to date.  In 2015, Cheryl announced she was working on her fifth studio album, initially due for release in 2016.

Answer this question "How long was she a judge on the X Factor?" by extracting the answer from the text above.
Cheryl returned to The X Factor for its twelfth series;