Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Havina is a Python library that can generate knowledge graphs triplets from an input text. Its implementation is based on the paper "Language models are open knowledge graphs" with some tweaks to improve performance. Havina can be used to evaluate the language comprehension of AI models or as a tool to extract triplets from text and build knowledge graphs.
Havina is a Python library that can generate knowledge graphs triplets from an input text. Its implementation is based on the paper "Language models are open knowledge graphs" with some tweaks to improve performance. Most notably, instead of summing the attention scores of each word in a relation, I am calculating their average.
The reasoning behind this change is that a simple sum of scores favors longer relations even if the extra words do not carry any relevant meaning.
Havina can be used to evaluate the language comprehension of AI models or as a tool to extract triplets from text and build knowledge graphs.
Run pip install havina
to install the library. Then, after importing the GraphGenerator
class
from havina, simply call the object with the sentence to evaluate and an optional number of workers.
Each worker will span a different process and the algorithm will split the work between them.
from havina import GraphGenerator
text = 'John Lennon is a famous singer.'
generator = GraphGenerator(
top_k=4,
contiguous_token=False
)
triplets = generator(text, workers=1)
print(triplets)
The code above will print the following:
[
HeadTailRelations(
head=Entity(text='john lennon', wikidata_id=None),
tail=Entity(text='a famous singer', wikidata_id=None),
relations=['be'])
]
The returned type is a list of HeadTailReations
objects, each of which contains
the head and tail entities and the possible relations between them. Relations are
Python strings.
FAQs
Havina is a Python library that can generate knowledge graphs triplets from an input text. Its implementation is based on the paper "Language models are open knowledge graphs" with some tweaks to improve performance. Havina can be used to evaluate the language comprehension of AI models or as a tool to extract triplets from text and build knowledge graphs.
We found that Havina demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.