0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

利用知识图谱与Llama-Index技术构建大模型驱动的RAG系统(下)

深度学习自然语言处理 来源:爱吃牛油果的璐璐 2024-02-22 14:13 次阅读

7、构建知识图谱索引

de52d9a6-cfed-11ee-a297-92fbcf53809c.png

#setuptheservicecontext

service_context=ServiceContext.from_defaults(
chunk_size=256,
llm=llm,
embed_model=embed_model
)

#setupthestoragecontext

graph_store=SimpleGraphStore()
storage_context=StorageContext.from_defaults(graph_store=graph_store)

#ConstructtheKnowlegeGraphUndex
index=KnowledgeGraphIndex.from_documents(documents=documents,
max_triplets_per_chunk=3,
service_context=service_context,
storage_context=storage_context,
include_embeddings=True)

8、从文档中创建知识图谱

Text:page_label:2
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

WhatisanESOP?
Triplets:
(page_label,is,2)
(ESOP,is,WhatisanESOP?)
---------------------
Text:page_label:3
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

WhyOfferanESOP?
Triplets:
(page_label,is,3)
(ESOP,is,WhyOfferanESOP?)
---------------------
Text:page_label:4
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-P
(page_label,is,partof)
(page_label,is,TableofContents)
(file_path,is,pathof)
(file_path,is,/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf)
(ESOP,is,partof)
(ESOP,is,IntrotoOptionsPlans)
(Option,is,partof)
(Option,is,IntrotoOptionsPlans)
(LifecycleofaStartupESOP,is,partof)
(LifecycleofaStartupESOP,is,IntrotoOptionsPlans)
(CommonTermsinanOptionsPackage,is,partof)
(CommonTermsinanOptionsPackage,is,IntrotoOptionsPlans)
(WhyIssueOptionstoEmployees,is,partof)
(WhyIssueOptionstoEmployees,is,IntrotoOptionsPlans)
(ADefiningCharacteristicofStartupCulture,is,partof)
(ADefiningCharacteristicofStartupCulture,is,WhyIssueOptionstoEm
(ESOP,is,equitycompensationplan)
(ESOP,is,employeestockoptionplan)
(ESOP,is,partofstartupculture)
(ESOP,is,necessarypartofcapitalstructure)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)
(ESOP,is,definedcharacteristicofstartupculture)

(page_label,is,3)
(INTROTOOPTIONSPLANS,is,PartI)
---------------------
Text:The2018AnnualReportoftheBoardofTrusteesoftheUniversityofArkansasSystemispresentedhereasaPDFfile.
Triplets:
(The,is,PDFfile)
(The,ispresented,here)
(The,is,The2018AnnualReportoftheBoardofTrusteesoftheUniversityofArkansasSystem)
---------------------
Text:The2018AnnualReportoftheBoardofTrusteesoftheUniversityofArkansasSystemispresentedhereasaPDFfile.
Triplets:
(The,is,PDFfile)
(The,ispresented,here)
(The,is,The2018AnnualReportoftheBoardofTrusteesoftheUniversityofArkansasSystem)
---------------------
Text:The2018AnnualReportoftheBoardofTrusteesoftheUniversityofArkansasSystemispresentedhereasaPDFfile.
Triplets:
(The,is,PDFfile)
(The,ispresented,here)
(The,
(ESOP,is,EmployeeStockOptionsPlan)
(ESOP,is,allocation)
(ESOP,is,plan)
---------------------
Text:page_label:5
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

WhatisanESOP?
•AnEmployeeStockOptionsPlan(ESOP)

•Anallocationofsharesthatwillbegrantedtoemployeesinthefuture
intheformofstockoptions
–Howmuchequityshouldwesetasideforemployees?

•Aplanforhowtheseoptionswillbedistributed:
–Howmanyshareswillindividualemployeesreceive?
–Whattermswillgovernthesegrants?

•Theplanisasimportantastheallocation!
Triplets:
(ESOP,is,allocation)
(ESOP,is,plan)
(ESOP,is,important)
---------------------
Text:page_label:6
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-
(Option,is,effectiveformofequityownership)
(Option,has,intrinsicvalue)
(Option,is,locked-inpriceforshares)
---------------------
Text:page_label:1
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

WhatisanESOP?
•WhatisanESOP?
–Aqualifiedretirementplan
–Atax-qualifieddefinedcontributionplan
–Aplanthatisprimarilydesignedto
provideretirementbenefitstoemployees
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–Aplanthatisprimarilydesignedto
providebenefitsintheformofstock
–
(Option,is,righttopurchase)
(Option,is,setprice)
(Option,is,certainperiodoftime)
---------------------
Text:page_label:1
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

WhatisanESOP?
•WhatisanESOP?
–Aqualifiedretirementplan
–Atax-qualifiedplanthatmeets
ERISArequirements
–Aplanthatisprimarilydesigned
toprovideretirementbenefitsto
employees
–Aplanthatisprimarilydesigned
toprovidebenefitsintheform
ofemployersecurities
–Aplanthatisprimarilydesigned
toprovidebenefitsintheform
ofemployersecuritiesthatare
acquiredthroughpurchase,
receiptfromacorporateparent,
orthroughtheaccumulationof
distributionsonemployersecurities
–Aplanthatisprimarilydesigned
toprovidebenefitsintheform
ofemployersecuritiesthatare
acquiredthroughtheaccumulation
of
(LifecycleofaStartupESOP,involves,foundersandearlyinvestors)
(LifecycleofaStartupESOP,involves,managementandtheBoardofDirectors)
(LifecycleofaStartupESOP,involves,employees)
(Employees,receive,optionspackages)
(Options,are,exercised)
(Options,are,granted)
(Options,are,issued)
(Options,are,marketable)
(Options,are,forfeitable)
(Options,are,vested)
(Shares,are,acquired)
(Shares,are,granted)
(Shares,are,marketable)
(Shares,are,owned)
(Shares,are,vested)
(Strikeprice,is,paid)
(Strikeprice,is,set)
(Strikeprice,is,specified)
---------------------
Text:page_label:11
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

LifecycleofaStartupESOP
•Found
(CommonTermsinanOptionsPackage,is,NumberofShares)
(CommonTermsinanOptionsPackage,is,StrikePrice)
(CommonTermsinanOptionsPackage,is,VestingSchedule)
(CommonTermsinanOptionsPackage,is,CliffPeriod)
(CommonTermsinanOptionsPackage,is,ExpirationDate)
---------------------
Text:page_label:1
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

ExecutiveSummary
Thisdocumentoutlinesthebestpracticesfordesigningandimplementinganemployeestockoptionplan(ESOP)foraprivatecompany.ThedocumentisintendedtoprovideaframeworkfordesigninganESOPthatistailoredtothespecificneedsofthecompanyanditsemployees.ThedocumentisnotintendedtobeacomprehensiveguidetoESOPdesign,butratherahigh-leveloverviewofthekeyconsiderationsthatshouldbetakenintoaccountwhendesigninganESOP.
Triplets:
(ExecutiveSummary,is,High-leveloverview)
(ExecutiveSummary,is,Keyconsiderations)
(ExecutiveSummary
(WhyIssueOptionstoEmployees?,attracts,toprecruits)
(WhyIssueOptionstoEmployees?,retains,employees)
(WhyIssueOptionstoEmployees?,aligns,incentives)
(WhyIssueOptionstoEmployees?,rewards,valuecreation)
(WhyIssueOptionstoEmployees?,encourages,long-termthinking)
---------------------
Text:page_label:10
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

HowShouldOptionsBeGranted?
•AttheRightTime:optionsshouldbegrantedattherighttimeinthe
company’slifecycle,whenthecompanyhasachievedacertainlevel
ofsuccessandthevalueofthecompanyisclear
•AttheRightPrice:optionsshouldbegrantedatafairprice,basedon
thecompany’svaluationatthetimeofgrant
•AttheRightSize:optionsshouldbegrantedintherightsize,based
ontheemployee’sroleandcontributiontothecompany
Triplets:
(
(Startups,are,uniquecase)
(Startups,use,options)
(Startups,seekingtoachieve,bigexit)
---------------------
Text:page_label:10
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

ThedefiningdifferencebetweenSiliconValleycompaniesandalmost
everyotherindustryintheU.S.Isthevirtuallyuniversalpracticeamong
techcompaniesofdistributingmeaningfulequity(usuallyintheformof
stockoptions)toordinaryemployees.ADefiningCharacteristicofStartupCulture
StevenJohnson,TechnologyWriter
•Startupsareauniquecase.Unlikeatlargercorporations,employee
ownershipisanessentialelementofstartupcommunitiesandculture
–Ashigh-risk/high-rewardenterprises,startupsuseoptionstoalign
employeecompensationwiththerisk-pronementalityofthe
business
–Startupsseekingtoachievea“bigexit”useoptionstoalignall
employeestodrivetowardthisdesiredoutcome
Triplets:
(Startups
(ESOP,is,necessarypartof,capitalstructure)
(VCs,require,ESOPs)
(Startups,arecompelled,tooffer,optionspackages)
---------------------
Text:page_label:11
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

TheESOPasaRecruitmentandRetentionTool
•ESOPsareacriticaltoolforrecruitingandretainingemployees
–Inacompetitivejobmarket,ESOPscanbeusedtoattracttoptalent
–Inatightlabormarket,ESOPscanbeusedtoretainkeyemployees
–Inavolatilemarket,ESOPscanbeusedtoretainemployeesduring
adownturn
–Inahigh-growthcompany,ESOPscanbeusedtoretainemployeesduring
aperiodofrapidexpansion
–Inacompanywithahighemployeeturnoverrate,ESOPscanbeusedto
reduceturnoverandassociatedcosts
–Inacompanywithahighexecutiveturnoverrate,ESOPscanbeusedto
(page_label:11,is,stage)
(stage,is,pre-seed)
(stage,is,seed)
(stage,is,early-vc)
---------------------
Text:page_label:11
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

page_label:12
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

page_label:14
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

page_label:15
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices
(ESOP,isnecessaryfor,Pre-seed)
(ESOP,isnotnecessaryfor,Pre-seed)
(ESOP,canbehelpfulfor,Pre-seed)
(ESOP,isnotnecessaryfor,Seed)
(ESOP,isrequiredfor,Early-VC)
(ESOP,mustbecreatedfor,Early-VC)
(ESOP,servesasaguidelinefor,Early-VC)
(ESOP,isimportanttohavestandardizedfor,Late-VC)
(ESOP,isgonefor,Growth)
(ESOP,sharesremainingaremorevaluablefor,Growth)
(ESOP,isusedtoallownewhirestoshareintheupsidefor,Growth)
(ESOP,shouldbesetupbetween,Pre-seedand,Early-VC)
---------------------
Text:page_label:12
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

HowMuchEquityShouldYouGrant?
StageConsiderationsTakeaway
Pre-seedFound
(Communicatingoptionstoemployees,canbecommunicated,%versus$)
(Communicatingoptionstoemployees,canbecommunicated,%)
(Communicatingoptionstoemployees,canbecommunicated,$)
(Communicatingoptionstoemployees,canbecommunicated,0.5%)
(Communicatingoptionstoemployees,canbecommunicated,$200,000)
---------------------
Text:page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

ExercisePrice:MarketPricevs.Discount
Whensettingtheexercisepriceforoptions,therearetwo
approaches:(1)setthepriceequaltothemarketpriceof
thestockatthetimeofgrant,or(2)setthepriceata
discounttothemarketprice.
MarketPrice:
•Fairtoemployeesandthecompany
•Notaxdeductionforcompany
•Employeescansellimmediately
•Employeescanexerciseimmediately
Discount:
(Communicationofoptionspackages,recommended,dollarvalue)
(Communicationofoptionspackages,recommendedagainst,percentofthecompany)
(Communicationofoptionspackages,effectivewhen,dollarvalue)
---------------------
Text:page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

or(2)adollarvaluebasedonthe
currentvaluation;weencouragethelatterwhenpossible
%$
“Wearegrantingyouoptionsequivalentto
0.5%ofthecompany’sequity”
Considerations:
•Atanearlystage,theonlyway
tocommunicateoptionsgrantsgivennotrue
valuationofthecompany
•Hardforemployeestograspwhatthey
arereallygetting(“0.5%seemstoolittle”)
•Invitesanegotiationaboutwhatpercent
ofthecompanyanemployeereally
deserves“Wearegrantingyouoptionsequivalentto
$200,000ofcompanystock”
Considerations
(page_label,is,12)
(file_path,is,/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf)
(5%,is,equivalentto)
(5%,is,$200,000ofcompanystock)
(Considerations,is,highlyeffectivewaytocommunicatethetruevalueofanoptionsgrant)
---------------------
Text:The2018FIFAWorldCupwasthe21stFIFAWorldCup,aninternationalmen'sfootballtournamentcontestedbythenationalteamsofFIFAmemberassociations.IttookplaceinRussiafrom14Juneto15July2018.ItwasthefirstWorldCuptobeheldinEasternEurope,andthe11thtimethatithadbeenheldinEurope.Atanestimatedcostofover$14.2billion,itisthemostexpensiveWorldCup.
Triplets:
(2018FIFAWorldCup,is,21stFIFAWorldCup)
(2018FIFAWorldCup,tookplacein,Russia)
(201
(HOWMUCHTOGRANT,PartII,)
---------------------
Text:page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

HOWMUCHTOGRANTPartII
Triplets:
(HOWMUCHTOGRANT,PartII,)
---------------------
Text:page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

HOWMUCHTOGRANTPartII
Triplets:
(HOWMUCHTOGRANT,PartII,)
---------------------
Text:page_label:13
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

HOWMUCHTOGRANTPartII
Triplets:
(HOWMUCHTOGRANT,PartII,)
----------------
(TwoApproaches,is,reality)
(CreatinganESOP,requires,acombinationoftop-downandbottom-upplanning)
(Decidethetotalamountofequitytobegranted,is,partofcreatinganESOP)
(Allocatethesesharestoemployeesovertime,is,partofcreatinganESOP)
(Decidetheappropriatesizeofindividualequitygrantsbyposition,is,partofcreatinganESOP)
(Issuethesesharesasemployeesarehired,is,partofcreatinganESOP)
---------------------
Text:page_label:15
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

TwoApproaches
Inreality,creatinganESOPwillrequireacombinationof
top-downandbottom-upplanningTopDownBottomUp
Decidethetotalamountof
equitytobegranted;allocate
thesesharestoemployees
overtimeDecidetheappropriatesizeof
individualequitygrantsby
position;issuethesesharesas
employeesare
(Top-DownProcess,consistsof,determining)
(Top-DownProcess,consistsof,creating)
(Top-DownProcess,consistsof,scheduling)

Text:page_label:16
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

TheBottom-UpProcess
1.Determinethenumberofsharestobegrantedtoeachemployee
2.Determinethegrantdate
3.Determinethevestingschedule
Triplets:
(Bottom-UpProcess,consistsof,determining)
(Bottom-UpProcess,consistsof,determining)
(Bottom-UpProcess,consistsof,determining)

Text:page_label:17
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

TheBottom-UpProcess(continued)
1.Determinetheexerciseprice
2.Determinetheexpirationdate
Triplets:
(Bottom-UpProcess,consists
(page_label,is,16)
(page_label,represents,howmuchequitytosetasideintheesop)
(page_label,has,valuesof15-20%forgenerallynon-founderemployees)
---------------------
Text:The2018-19budgetfortheDepartmentofEnergy(DOE)includes$3.7billionfortheOfficeofScience(SC),anincreaseof$645million(21.1%)overthe2018enactedlevel.
Triplets:
(The,2018-19budgetfortheDepartmentofEnergy,includes,$3.7billionfortheOfficeofScience)
(The,2018-19budgetfortheDepartmentofEnergy,is,anincreaseof$645millionoverthe2018enactedlevel)
(The,2018-19budgetfortheDepartmentofEnergy,represents,a21.1%increaseoverthe2018enactedlevelfortheOfficeofScience)
---------------------
Text:The2018
(page_label,is,16)
(file_path,is,/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf)
(no,is,0)
(technologyemphasis,is,0)
(geographicfocus,is,regionthatisnotconsideredastartuphub)
(hiringneeds,areprimarily,administrativeorback-officeteammembers)
(percentageofcompanyissuedtononfounderemployees,isbetween,15%and20%)
(founders,are,topmanagers,buthireotherstofillkeytechnicalorfunctionalroles)
(dnaofthecompany,is,applyingtechnologytoanon-technicalindustry)
(geographicfocus,is,eitherwhollyorpartiallyinastartuphub)
(hiringneeds,areprimarily,salesandmarketingteammembers)
(founders,arenottopmanagersinthebusiness,orplantostepaside)
(dnaofthecompany,is,technology,engineering,ordatascience)
(geographicfocus,is,inaleadingstartuphubsuchassf,
(page_label,is,16)
(file_path,is,/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf)
(companies,issue,upto25%)
(founders,are,topmanagers)
(founders,arenot,topmanagersinthebusiness,or)
(DNA,is,inapplyingtechnologytoanon-technicalindustry)
(DNA,is,intechnology,engineering,ordatascience)
(geographicfocus,is,whollyorpartiallyinastartuphub)
(geographicfocus,is,inaleadingstartuphubsuchasSF,NYCorBoston)
(hiringneeds,are,primarilysalesandmarketingteammembers)
(hiringneeds,are,primarilyengineering,development,ortechnicalteammembers)
---------------------
Text:The2018-19seasonoftheNationalBasketballAssociation(NBA)isthe72ndseasonoftheNationalBasketballAssociation.
Triplets:
(2018-19season,is,the7
(TypicalDistributionSchedule,consistsof,Seniority)
(TypicalDistributionSchedule,consistsof,EquityAllocation)
(First,consistsof,10%)
(Next,consistsof,5%)
(Next,consistsof,5%)
(CTO,consistsof,1-5%)
(KeyDeveloperorEngineer,consistsof,1-2%)
(OtherFunctionalTeamMember,consistsof,0.5-1.5%)
(Nonon-foundingmemberoftheseniorteam,shouldnotexceed,10%)
---------------------
Text:page_label:18
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

3.VestingSchedule
•Fouryearvestingscheduleismostcommon.
•Cliffvestingislesscommon,butcanbeusedtoretainkeyemployees.
•Monthlyvestingislesscommon,butcanbeusedtoalignemployeeinterestswithcompanyperformance.
Triplets:
(VestingSchedule,ismostcommon
(Bottom-UpProcess,consistsof,Segmentyourhumanresources)
(Bottom-UpProcess,consistsof,Createpaymultipliersforeachjobfunction)
(Bottom-UpProcess,consistsof,Determinethedollarvalueofanoptionsgrant)
(Bottom-UpProcess,consistsof,Determinethecurrentshareprice)
(Bottom-UpProcess,consistsof,Calculateoptionsgrants)
---------------------
Text:page_label:19
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

TheTop-DownProcess
1.Determinethetotaldollaramounttobespentonoptions
2.Determinethenumberofsharestobereservedforoptions
3.Determinethenumberofoptionstobegranted
4.Determinetheexerciseprice
5.Determinethevestingschedule
Triplets:
(Top-DownProcess,consistsof,Determinethetotaldollaramounttobespentonoptions)
(Top-DownProcess,consistsof,Determinethenumberofsharestobereservedforoptions)
(Top-
(SegmentYourHumanResources,is,segmentation)
(SegmentYourHumanResources,has,SegmentRoles)
(SegmentYourHumanResources,has,Award)
---------------------
Text:page_label:20
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

2.CommunicateEarlyandOften
•Communicatetheplantoallemployeesassoonaspossible
•Communicatetheplantoallnewhiresaspartoftheirorientation
•Communicatetheplantoallemployeesatleastannually
•Communicatetheplantoallemployeeswhenthereisamaterialchange
Triplets:
(CommunicateEarlyandOften,is,communication)
(CommunicateEarlyandOften,has,Communicatetheplantoallemployeesassoonaspossible)
(CommunicateEarlyandOften,has,Communicatetheplantoallnewhiresaspartoftheirorientation)
(CommunicateEarlyandOften,has,Communicatetheplantoallemployeesatleastannually)
(CommunicateEarlyandOften,
(2,establish,PayMultipliersforEachRole)
(Segment,Roles,2)
(Segment,Award,?)
---------------------
Text:page_label:21
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

3.EstablishVestingSchedules
SegmentVestingSchedule
inYearsor%?
Triplets:
(3,establish,VestingSchedules)
(Segment,VestingSchedule,?)
---------------------
Text:page_label:22
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

4.EstablishPerformanceCriteria
SegmentPerformanceCriteria
in%or$?
Triplets:
(4,establish,PerformanceCriteria)
(Segment,PerformanceCriteria,?)
---------------------
Text:page_label:23
file_path:/content/Documents/Employee-Stock-Option-
(page_label,is,20)
(2,establish,PayMultipliersforEachRole)
(Segment,is,Roles)
(Segment,is,Award)
(Segment,is,OptionsMultiplier)
(Segment,is,Founders)
(Segment,is,Co-Founders)
(Segment,is,%)
(Segment,is,FoundingTeam)
(Segment,is,Technical&Product)
(Segment,is,Early-StageHires)
(Segment,is,SeniorTeam)
(Segment,is,C-Level)
(Segment,is,Directors/VPs)
(Segment,is,Functional/TechnicalTeam)
(Segment,is,SupportTeam)
(Segment,is,$)
(Segment,is,0.5x)
(Segment,is,1.0x)
(Segment,is,0.25x)
(Segment,is,0.5x)
(Segment,is,0.1x)
(Segment,is,0.0x)
(page_label,is,2)

(Employee,BaseSalary,x)
(Employee,Options,x)
(Employee,OptionsMultiplier,basedontheemployee’sroleinHRsegmentationschedule)
---------------------
Text:page_label:21
file_path:/content/Documents/Employee-Stock-Option-Plans-ESOP-Best-Practices-2.pdf

3.DeterminetheDollarValueoftheOptionsGrant
Employee
BaseSalary=xOptions
MultiplierDollarValue
ofOptionsGrantBaseSalaryasnegotiatedwith
theemployeeatthetimeofhire
orpromotion
OptionsMultiplierisdecided
basedontheemployee’srolein
theHRsegmentationschedule
Triplets:
(Employee,BaseSalary,x)
(Employee,Options,x)
(Employee,OptionsMultiplier,basedontheemployee’sroleinHRsegmentationschedule)
---------------------
Text:page_label:21
file_path:/content/Documents/Employ

9、构建查询引擎来查询知识图谱

query='WhatisESOP?'
query_engine=index.as_query_engine(include_text=True,
response_mode='tree_summarize',
embedding_mode='hybrid',
similarity_top_k=5,)
#
message_template=f'''<|system|>PleasecheckifthefollowingpiecesofcontexthasanymentionofthekeywordsprovidedintheQuestion.Ifnotthendon'tknowtheanswer,justsaythatyoudon'tknow.Stopthere.Pleasedonottrytomakeupananswer.
<|user|>
Question:{query}
HelpfulAnswer:
'''
#
response=query_engine.query(message_template)
#
print(response.response.split('<|assistant|>')[-1].strip())
#####OUTPUT#####################
ESOPstandsforEmployeeStockOwnershipPlan.Itisaretirementplanthatallowsemployeestoreceivecompanystockorstockoptionsaspartoftheircompensation.Insimplerterms,itisaplanthatallowsemployeestoownaportionofthecompanytheyworkfor.Thiscanbeamotivatingfactorforemployeesastheyhaveadirectstakeinthecompany'ssuccess.ESOPscanalsobeatax-efficientwayforcompaniestoprovideretirementbenefitstotheiremployees.


query='WhoisAtul?'
message_template=f'''<|system|>PleasecheckifthefollowingpiecesofcontexthasanymentionofthekeywordsprovidedintheQuestion.Ifnotthendon'tknowtheanswer,justsaythatyoudon'tknow.Stopthere.Pleasedonottrytomakeupananswer.
<|user|>
Question:{query}
HelpfulAnswer:
'''
#
response=query_engine.query(message_template)
#
print(response.response.split('<|assistant|>')[-1].strip())

################OUTPUT#####################
Idonothavepriorknowledgeorcontextaboutwhoatulis.PleaseprovidemoreinformationorcontextsoIcanassistyoubetter.Withoutanyfurthercontext,Idonotknowtheanswertoyourquestion.

10、可视化表示

frompyvis.networkimportNetwork
fromIPython.displayimportdisplay
g=index.get_networkx_graph()
net=Network(notebook=True,cdn_resources='in_line',directed=True)
net.from_nx(g)
net.show('graph.html')
net.save_graph('Knowledge_graph.html')
#
importIPython
IPython.display.HTML(filename='/content/Knowledge_graph.html')

11、持久化保存

storage_context.persist()

总结

对于语言模型(LLM)幻觉,知识图谱被证明优于向量数据库。知识图谱提供更准确、多样化、有趣、逻辑和一致的信息,减少了LLM中出现幻觉的可能性。这种优越性源于它们能够提供关于实体之间关系的精确细节,而不仅仅是表示相似性,支持更复杂的查询和逻辑推理。

向量数据库以其数字数组在相似性搜索和最佳匹配场景中表现出色。最终,两者之间的选择取决于项目的需求,包括数据的性质、关系探索的需要以及预期的查询类型。

审核编辑:黄飞

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 数据库
    +关注

    关注

    7

    文章

    3770

    浏览量

    64301
  • 语言模型
    +关注

    关注

    0

    文章

    514

    浏览量

    10252
  • 知识图谱
    +关注

    关注

    2

    文章

    132

    浏览量

    7696
  • 大模型
    +关注

    关注

    2

    文章

    2354

    浏览量

    2539
  • LLM
    LLM
    +关注

    关注

    0

    文章

    279

    浏览量

    310

原文标题:借助知识图谱和Llama-Index实现基于大模型的RAG-下

文章出处:【微信号:zenRRan,微信公众号:深度学习自然语言处理】欢迎添加关注!文章转载请注明出处。

收藏 人收藏

    评论

    相关推荐

    分享自底向上构建知识图谱的过程

    一文揭秘!自底向上构建知识图谱全过程
    发表于 09-29 14:27

    KGB知识图谱基于传统知识工程的突破分析

    知识图谱工程相比,其使用效果主要是受到其数据规模的影响。大数据时代,受益于海量数据、强大的计算能力和群智计算,知识图谱能够自动构建大规模、高质量的知识库,从
    发表于 10-22 15:25

    KGB知识图谱技术能够解决哪些行业痛点?

    具有有效性。KGB知识图谱凭借其在知识图谱构建,更新方面的技术优势,现在已经在公共安全,企业文件内容核查等得以广泛应用。KGB知识图谱现已
    发表于 10-30 15:34

    知识图谱的三种特性评析

    的三个重要方面包括目标的动态性。比如根据已有的知识图谱模型,能否一个在人工不干预的情况,自动识别出同类事物;当一名影星再婚之后,是否可以在人工不干预的情况,自动识别他的新配偶。(2
    发表于 12-13 13:57

    KGB知识图谱通过智能搜索提升金融行业分析能力

    的自然语言处理技术,搭建专业领域深度知识图谱,快速学习并迭代金融行业最新知识构建一二级市场众多实体模型,智能化的理解用户的搜索请求,使得搜
    发表于 06-22 21:23

    如何使用知识图谱对图像语义进行分析技术及应用研究

    模型对图像的机构化语义信息进行描述和抽取,在此基础上研究了基于知识图谱的图像语义知识融合和加工技术构建后的多层次图像语义
    发表于 11-21 17:05 17次下载
    如何使用<b class='flag-5'>知识图谱</b>对图像语义进行分析<b class='flag-5'>技术</b>及应用研究

    知识图谱在工程应用中的关键技术、应用及案例

    近年来,知识图谱及其相关技术得到快速发展,并被广泛应用于工业界各种认知智能场景中。在简述知识图谱相关研究的基础上,介绍知识图谱在工程应用中的关键技术
    发表于 03-30 15:12 15次下载
    <b class='flag-5'>知识图谱</b>在工程应用中的关键<b class='flag-5'>技术</b>、应用及案例

    通用知识图谱构建技术的应用及发展趋势

    构建平台,需要对知识图谱构建体系进行研究,以满足不同的行业应用需求。文中以知识图谱构建为主线,首先介绍目前主流的通用
    发表于 04-14 11:37 27次下载
    通用<b class='flag-5'>知识图谱</b><b class='flag-5'>构建</b><b class='flag-5'>技术</b>的应用及发展趋势

    知识图谱Knowledge Graph构建与应用

    一、知识图谱概论         1.1知识图谱的起源和历史 1.2知识图谱的发展史——从框架、本体论、语义网、链接数据到知识图谱 1.3知识图谱
    发表于 09-17 10:12 639次阅读

    知识图谱知识图谱的典型应用

    作者: cooldream2009  我们构建知识图谱的目的,在于利用知识图谱来做一些事情。有效利用知识
    的头像 发表于 10-18 09:26 1889次阅读
    <b class='flag-5'>知识图谱</b>:<b class='flag-5'>知识图谱</b>的典型应用

    基于本体的金融知识图谱自动化构建技术

    本评测任务参考 TAC KBP 中的 Cold Start 评测任务的方案,围绕金融研报知识图谱的自动化图谱构建所展开。评测从预定义图谱模式(Schema)和少量的种子
    的头像 发表于 11-24 14:54 1112次阅读

    如何利用模型构建知识图谱?如何利用模型操作结构化数据?

    上图是之前,我基于大语言模型构建知识图谱的成品图,主要是将金融相关的股票、人物、涨跌幅之类的基金信息抽取出来。
    的头像 发表于 08-24 16:56 1.5w次阅读
    如何<b class='flag-5'>利用</b>大<b class='flag-5'>模型</b><b class='flag-5'>构建</b><b class='flag-5'>知识图谱</b>?如何<b class='flag-5'>利用</b>大<b class='flag-5'>模型</b>操作结构化数据?

    知识图谱与大模型结合方法概述

    本文作者 |  黄巍 《Unifying Large Language Models and Knowledge Graphs: A Roadmap》总结了大语言模型知识图谱融合的三种路线:1
    的头像 发表于 10-29 15:50 946次阅读
    <b class='flag-5'>知识图谱</b>与大<b class='flag-5'>模型</b>结合方法概述

    利用知识图谱Llama-Index技术构建模型驱动RAG系统(上)

    向量数据库是一组高维向量的集合,用于表示实体或概念,例如单词、短语或文档。向量数据库可以根据实体或概念的向量表示来度量它们之间的相似性或关联性。
    的头像 发表于 02-22 14:07 1061次阅读
    <b class='flag-5'>利用</b><b class='flag-5'>知识图谱</b>与<b class='flag-5'>Llama-Index</b><b class='flag-5'>技术</b><b class='flag-5'>构建</b>大<b class='flag-5'>模型</b><b class='flag-5'>驱动</b>的<b class='flag-5'>RAG</b><b class='flag-5'>系统</b>(上)

    知识图谱与大模型之间的关系

    在人工智能的广阔领域中,知识图谱与大模型是两个至关重要的概念,它们各自拥有独特的优势和应用场景,同时又相互补充,共同推动着人工智能技术的发展。本文将从定义、特点、应用及相互关系等方面深入探讨
    的头像 发表于 07-10 11:39 941次阅读