首页 \ 问答 \ Lucene,MoreLikeThis的替代品?(Lucene, Alternatives to MoreLikeThis?)

Lucene,MoreLikeThis的替代品?(Lucene, Alternatives to MoreLikeThis?)

我正在为餐厅建立推荐系统。 每家餐厅都以文件形式出现。 它具有以下功能(字段),菜肴,设施,类型。

现在,我阅读了MoreLikeThis Query。 它根据术语频率找到类似的文件。 因此,它会忽略例如以下菜单的两个文档

“牛排馆澳大利亚无麸质”

因为lucene索引不会考虑它们的重要条款,因为它们只出现一次。

是否有任何其他查询忽略术语频率? 并根据匹配的最大关键字数量找到类似的文档?


I am building a recommender system for restaurants. Each restaurant is represented in the form of documents. It has the following features(fields), Cuisine, Facilities, Types.

Now, I read about MoreLikeThis Query. It finds similar documents based on term frequencies. So, it ignores for example, two documents with the following Cuisine

"steakhouse australian gluten-free"

because, lucene index doesnot consider them important terms, because they only occur once.

Is there any other query that ignores term frequencies? and just finds similar documents based on largest number of keywords matched?


原文:https://stackoverflow.com/questions/37629186
更新时间:2022-07-08 18:07

最满意答案

据推测,在interfaces.dll中定义并由项目A实现的接口没有改变? 也许其他项目刚刚添加了新界面。

你可能在这里有一个普通的旧的.NET DLL版本问题。 项目A(A.exe?)是针对interfaces.dll版本1.0.0.0编译的,并且此信息存储在A.exe的元数据中。 当您更新interfaces.dll到1.0.0.1时,A.exe无法加载它。 如果新的DLL是向后兼容的(它确实必须让你的强制转换工作),那么你可以提供一个策略文件告诉运行时加载器这种兼容性。 例如:

<?xml version ="1.0"?>
<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="interfaces" culture="neutral" publicKeyToken="null"/>
        <bindingRedirect oldVersion="1.0.0.0-1.0.0.1" newVersion="1.0.0.1"/>
    </dependentAssembly>
    </assemblyBinding>
</runtime>
</configuration>

这告诉加载程序,如果程序集试图在1.0.0.0和1.0.0.1之间加载任何版本的interfaces.dll,则可以接受版本1.0.0.1。 在您的DLL之后使用标准模式命名该文件: policy.1.0.interfaces.xml 。 然后把它放在与A.exe相同的目录下(我想)。

或者,如果您没有更改interfaces.dll的版本号(您确实应该这样做),那么您可能会遇到不同的问题。 如果你有两个程序集的身份相同,但它们实际上不是相同的程序集,那么一旦运行时加载程序加载了其中的一个程序集,它将永远不会加载第二个程序集。 有更多的细节,但因为我认为这不太可能是你的问题,我现在不会进入他们的问题。


Presumably the interfaces defined in interfaces.dll and implemented by project A haven't changed? Maybe the other projects have just added new interfaces.

You might have a plain old .NET DLL versioning issue here. Project A (A.exe?) is compiled against interfaces.dll version 1.0.0.0, and this information is stored in A.exe's metadata. When you update interfaces.dll to 1.0.0.1, A.exe can't load it. If the new DLL is backwards compatible (which it really must be for your casts to work) then you can supply a policy file that tells the runtime loader about this compatibility. For example:

<?xml version ="1.0"?>
<configuration>
<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="interfaces" culture="neutral" publicKeyToken="null"/>
        <bindingRedirect oldVersion="1.0.0.0-1.0.0.1" newVersion="1.0.0.1"/>
    </dependentAssembly>
    </assemblyBinding>
</runtime>
</configuration>

This tells the loader that if an assembly tries to load any version of interfaces.dll between 1.0.0.0 and 1.0.0.1, then version 1.0.0.1 is acceptable. Name this file after your DLL, using a standard pattern: policy.1.0.interfaces.xml. Then put it in the same directory as your A.exe (I think.)

Alternatively, if you haven't changed the version number of interfaces.dll (which you really should) then you might have a different problem. If you've got two assemblies whose identities are the same but they're not actually the same assemblies, then once the runtime loader has loaded one of them it will never load the second. There are more details, but since I reckon this is unlikely to be your problem I won't go into them right now.

相关问答

更多
  • 你需要使用一个dependentAssembly和bindingRediret,但你也需要把dll放在不同的文件夹中o用不同的名字保存。 完成这个后,你可以在你的app.config中找到它
  • 据推测,在interfaces.dll中定义并由项目A实现的接口没有改变? 也许其他项目刚刚添加了新界面。 你可能在这里有一个普通的旧的.NET DLL版本问题。 项目A(A.exe?)是针对interfaces.dll版本1.0.0.0编译的,并且此信息存储在A.exe的元数据中。 当您更新interfaces.dll到1.0.0.1时,A.exe无法加载它。 如果新的DLL是向后兼容的(它确实必须让你的强制转换工作),那么你可以提供一个策略文件告诉运行时加载器这种兼容性。 例如:
  • 您需要安装库所需的最新版本(最高版本)以及将旧版本重定向到新版本的策略文件。 您可以使用Visual Studio安装的合并模块。 它们通常位于C:\Program Files\Common Files\Merge Modules 。 请参阅MergeRef元素以及如何使用安装程序安装Visual C ++可再 MergeRef组件的示例。 您还需要将策略合并模块添加到您的安装中。 Neither heat nor Votive does support the requested feature. The ...
  • 您可以在没有VS附加的情况下运行时使用Procmon(过程监视器)进行自我检查。 在我的脑海中,我记得当JIT编译器第一次遇到类型时它们是按需加载的。 实际上,我使用混合解决方案(托管和非托管程序集),当缺少非托管dll时,首次需要该程序集中的类型时会出现错误; 在VS上运行时,我甚至得到了调用堆栈。 但我从未在外面检查过VS. 至于背后的理论, 这个问题有很长的解释。 You can check yourself using Procmon (Process Monitor) while running ...
  • 这可能不是原因,但没有为MatrixMxN类定义的复制构造函数或赋值运算符:通过将它们声明为private来定义它们或使对象不可复制。 虽然这个例子不是问题,但如果rows > 0但cols <= 0则会在析构函数中的未初始化指针上调用delete[] 。 在构造函数中,如果rows > 0 && cols > 0 ,则只能初始化entry 。 如果rows > 0但cols <= 0 ,则析构函数中的以下for循环仍会调用delete[] entry[i]; : for(int i=0; i
  • 您想要将具有相同名称(common.dll)的两个不同DLL加载到同一个进程中。 这对我来说似乎是个坏主意。 它真的有必要吗? 其中一个可以重新命名吗? 确保您加载的DLL可以找到其他不在搜索路径中的DLL。 (如果你没有动态加载DLL.dll和DLL2.dll,那么我不知道会是什么。幸运的是,我看到你是。:)) 如果您动态加载DLL.dll和DLL2.dll(即在运行时使用LoadLibrary,而不是在构建时链接到它们的.lib文件),则可以事先调用SetDllDirectory以明确将DLL或DLL2 ...
  • 它解决了! Matlab有一些增强库,MSV和matlab之间的链接虽然在链接器中被提到但是没有用。 我将这些dll文件复制到当前文件夹,现在它正在运行。 It's solved! Matlab has some boost libraries and the link between MSV and matlab was not working though it was mentioned in linker. I copied those dll files to the current folder ...
  • 假设您拥有该函数的地址,您应该能够使用以下内容来确定模块的基址。 HMODULE ModuleFromAddress(void *address) { MEMORY_BASIC_INFORMATION mbi; if (VirtualQuery(address, &mbi, sizeof(mbi)) != 0) return (HMODULE)mbi.AllocationBase; return NULL; } 然后将其结果提供给GetModuleFileName Assuming t ...
  • 使用延迟加载并实现dliNotePreLoadLibrary通知挂钩来加载正确版本的DLL。 链接器提供的延迟加载逻辑然后将从您加载的DLL中提取所有函数。 http://msdn.microsoft.com/en-us/library/z9h1h6ty(v=VS.100).aspx 或者在调用任何可能无法加载的函数之前使用延迟加载并实现您的函数来检查操作系统版本(因为它在旧操作系统中不存在)。 Use delayloading and implement the dliNotePreLoadLibrary ...
  • 正如Al Kepp回答的那样,你可以使用Dependency Walker,“Depends.exe”。 对于动态加载的DLL,最好的方法是在加载库时对应用程序进行概要分析。 在Dependency Walker中打开EXE, 而不是你的DLL。 然后单击“配置文件 - >开始分析”。 如果应用程序需要参数,您可以在打开的窗口中提供它们,否则只需单击“确定”即可启动该程序。 程序打开后,以正常方式使用它,以便加载DLL。 现在您的DLL已加载,您应该能够在Dependency Walker中浏览树以查看正在 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)