7、構建知識圖譜索引
#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文章
3763瀏覽量
64274 -
語言模型
+關注
關注
0文章
504瀏覽量
10245 -
知識圖譜
+關注
關注
2文章
132瀏覽量
7693 -
大模型
+關注
關注
2文章
2322瀏覽量
2479 -
LLM
+關注
關注
0文章
272瀏覽量
305
原文標題:借助知識圖譜和Llama-Index實現基于大模型的RAG-下
文章出處:【微信號:zenRRan,微信公眾號:深度學習自然語言處理】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
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次下載
知識圖譜在工程應用中的關鍵技術、應用及案例
近年來,知識圖譜及其相關技術得到快速發展,并被廣泛應用于工業界各種認知智能場景中。在簡述知識圖譜相關研究的基礎上,介紹知識圖譜在工程應用中的關鍵技術
發表于 03-30 15:12
?15次下載
通用知識圖譜構建技術的應用及發展趨勢
構建平臺,需要對知識圖譜的構建體系進行研究,以滿足不同的行業應用需求。文中以知識圖譜構建為主線,首先介紹目前主流的通用
發表于 04-14 11:37
?27次下載
知識圖譜Knowledge Graph構建與應用
一、知識圖譜概論 ? ? ? ? 1.1知識圖譜的起源和歷史 1.2知識圖譜的發展史——從框架、本體論、語義網、鏈接數據到知識圖譜 1.3知識圖譜
發表于 09-17 10:12
?631次閱讀
基于本體的金融知識圖譜自動化構建技術
本評測任務參考 TAC KBP 中的 Cold Start 評測任務的方案,圍繞金融研報知識圖譜的自動化圖譜構建所展開。評測從預定義圖譜模式(Schema)和少量的種子
知識圖譜與大模型結合方法概述
本文作者 |? 黃巍 《Unifying Large Language Models and Knowledge Graphs: A Roadmap》總結了大語言模型和知識圖譜融合的三種路線:1
利用知識圖譜與Llama-Index技術構建大模型驅動的RAG系統(上)
向量數據庫是一組高維向量的集合,用于表示實體或概念,例如單詞、短語或文檔。向量數據庫可以根據實體或概念的向量表示來度量它們之間的相似性或關聯性。
知識圖譜與大模型之間的關系
在人工智能的廣闊領域中,知識圖譜與大模型是兩個至關重要的概念,它們各自擁有獨特的優勢和應用場景,同時又相互補充,共同推動著人工智能技術的發展。本文將從定義、特點、應用及相互關系等方面深入探討知
評論