LightRAG icon indicating copy to clipboard operation
LightRAG copied to clipboard

Confusion about the double quotation marks (&quot or ") in the entity name

Open xandery-geek opened this issue 1 year ago • 0 comments

Hi, Thank you for this good work!

However, I am confused about the double quotation marks (&quot or ") in the entity name.

image

As the code in this function, all extracted attributes are enclosed in quotation marks. I think we need to remove quotation marks since we fail to remove the whitespace before or after the entity name.

For example, If we get an attribute '"ROMAN EMPIRE "', we cannot remove the whitespace in this attribute with clean_str() function. As a result, we will get the following node, whose id has an unwanted whitespace.

<node id="&quot;ROMAN EMPIRE &quot;">
      <data key="d0">"ORGANIZATION"</data>
      <data key="d1">"xxx"</data>
      <data key="d2">chunk-xxx</data>
 </node>

In some cases, it would result in some duplicated nodes, like "&quot;ROMAN EMPIRE &quot;" and "&quot;ROMAN EMPIRE&quot;" Is this feature a bug?

xandery-geek avatar Jan 09 '25 15:01 xandery-geek