Facebook CEO Mark Zuckerberg predicted Tuesday it will be five to 10 years before Facebook has technological tools in place to flag and remove hate speech from the platform before it is posted.

During testimony before a joint hearing with the Senate Judiciary and Commerce committees, Commerce Committee Chairman John Thune, R-S.D., asked Zuckerberg what challenges Facebook faces with evaluating hate speech versus legitimate political discourse.

[Related: 9 key moments from Mark Zuckerberg's testimony on Capitol Hill]

Zuckerberg noted it’s more difficult for Facebook to rely on technology to root out hate speech compared to other content on the platform, such as terrorist propaganda.

“Some problems lend themselves more easily to AI solutions than others,” Zuckerberg told Thune. “Hate speech is one of the hardest, because determining if something is hate speech is very linguistically nuanced. You need to understand what is a slur and whether something is hateful, not just in English, but a majority of people on Facebook use it in languages that are different across the world.”

Facebook has developed and deployed AI tools to find terrorist propaganda, Zuckerberg said, and nearly all ISIS and al Qaeda content that is removed from Facebook is flagged before “any human sees it.”

“That’s a success in terms of rolling out AI tools that can proactively police and enforce safety across the community,” Zuckerberg said. “Hate speech, I am optimistic that over a five to 10 year period we'll have AI tools that can get into some of the nuances, the linguistic nuances of different types of content to be more accurate in flagging things for our systems, but today is just not there on that.”

The Facebook CEO said that by the end of 2018, the company will have 20,000 employees devoted to security and content review.

Zuckerberg is testifying on Capitol Hill to discuss the social media company’s abuse of user data. The hearing comes after it was revealed Cambridge Analytica improperly harvested and misused information from millions of Facebook profiles.

News reports initially indicated Cambridge Analytica, a data firm that worked with the Trump campaign, gathered data from 50 million Facebook profiles, but Facebook acknowledged last week 87 million users were affected.