7、構(gòu)建知識(shí)圖譜索引
#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、從文檔中創(chuàng)建知識(shí)圖譜
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、構(gòu)建查詢引擎來(lái)查詢知識(shí)圖譜
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()
總結(jié)
對(duì)于語(yǔ)言模型(LLM)幻覺(jué),知識(shí)圖譜被證明優(yōu)于向量數(shù)據(jù)庫(kù)。知識(shí)圖譜提供更準(zhǔn)確、多樣化、有趣、邏輯和一致的信息,減少了LLM中出現(xiàn)幻覺(jué)的可能性。這種優(yōu)越性源于它們能夠提供關(guān)于實(shí)體之間關(guān)系的精確細(xì)節(jié),而不僅僅是表示相似性,支持更復(fù)雜的查詢和邏輯推理。
向量數(shù)據(jù)庫(kù)以其數(shù)字?jǐn)?shù)組在相似性搜索和最佳匹配場(chǎng)景中表現(xiàn)出色。最終,兩者之間的選擇取決于項(xiàng)目的需求,包括數(shù)據(jù)的性質(zhì)、關(guān)系探索的需要以及預(yù)期的查詢類型。
審核編輯:黃飛
-
數(shù)據(jù)庫(kù)
+關(guān)注
關(guān)注
7文章
3799瀏覽量
64388 -
語(yǔ)言模型
+關(guān)注
關(guān)注
0文章
524瀏覽量
10277 -
知識(shí)圖譜
+關(guān)注
關(guān)注
2文章
132瀏覽量
7707 -
大模型
+關(guān)注
關(guān)注
2文章
2448瀏覽量
2701 -
LLM
+關(guān)注
關(guān)注
0文章
288瀏覽量
334
原文標(biāo)題:借助知識(shí)圖譜和Llama-Index實(shí)現(xiàn)基于大模型的RAG-下
文章出處:【微信號(hào):zenRRan,微信公眾號(hào):深度學(xué)習(xí)自然語(yǔ)言處理】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論