facebook - 您将如何编写类似于 Facebook Graph Search 的解析器

标签 facebook algorithm parsing search

我已经阅读了很多文章,其中提供了一些关于 Facebook 如何实现其 Graph Search 的背景信息。所有这些似乎只是浏览了他们正在使用的解析器的实际实现细节。

https://www.facebook.com/notes/facebook-engineering/under-the-hood-building-graph-search-beta/10151240856103920

从那个页面:

We combined various parsing techniques to build a substring parser: suppose a user inputs, say, "friends New York" and that we have defined a comprehensive set of all the potential page titles our system can handle. Our parser could then generate exactly the Graph Search titles that contain the user's input, including things like "friends who live in New York" and "friends who have visited New York." If we could find a way to appropriately rank those suggested titles for the Graph Search typeahead, we would have a good start.

我真的很想了解解决这个问题的方法。将使用什么算法/技术来编写这样的系统?

任何链接也将不胜感激。

最佳答案

我正在考虑实现类似的东西..想在这里问 Q,发现已经有人问过..

这是我一直在考虑的开始 -

  1. 假设 facebook 搜索引擎“知道”底层数据存储(一个复杂的图形)。因此,搜索引擎会理解“ friend ”、“亲戚”等关键词,而不是将它们视为英语中的琐碎词。

  2. 在这种情况下,一个好主意可能是将用户输入(使用客户端 javascript)解析为 JSON 并将其发送到搜索引擎.. 有几个好处.. 解析可以完成在客户端,通过不发送不需要的数据来节省网络带宽,服务器端处理解析的输入,因为 JSON 更好..等等

  3. 让我们将此 JSON 称为 fbJSON.. 因为除了是 JSON.. 它遵循特定格式.. 您可以为您的格式创建规范.. 这样 JSON 就会被发送到搜索引擎必然包含一些信息..这可以让生活更轻松一些..就像我们有 geoJSON 等..

  4. 使用NLP程序将用户输入解析成fbJSON【这个我还得考虑一下】

这是我正在着手采用的一种广泛方法。唯一的瓶颈是第 4 点。因为我在 NLP 方面没有太多经验。

关于facebook - 您将如何编写类似于 Facebook Graph Search 的解析器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14499255/

相关文章:

java - 为什么我不能在 SAXParser 中打开这个 XML?

css - 如何将 Facebook 嵌入视频设置为 100% 宽度

android - Android中Facebook Graph Api Search的实现

algorithm - 合并 'spatial' 元组列表

parsing - 我在这个函数中需要一个字符串吗?

解析需要大量前瞻的案例

jquery - facebook 喜欢标签 - word-wrap :break-word; doesnt work on FF and IE9+

php - 多个用户在php中使用mysql连接

将任意大小的字符串转换为任意精度的整数(bigint)

java - 如何实现 Luhn 算法?